Skip to content

Commit

Permalink
show open folder regardless of provider supplied folder. Fix #229
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Jul 12, 2020
1 parent 9b9e721 commit c509a17
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 38 deletions.
9 changes: 8 additions & 1 deletion Analogy/Analogy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Analogy.LogViewer.RegexParser" Version="1.0.5" />
<PackageReference Include="Analogy.LogViewer.RegexParser" Version="1.0.5" >
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Analogy.LogViewer.RSSReader" Version="1.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -637,6 +640,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Analogy.LogViewer.WindowsEventLogs" Version="1.0.8" >
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="LiorBanai.NotificationWindow" Version="1.0.3" />
<PackageReference Include="MessagePack" Version="2.1.152" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
Expand Down
6 changes: 4 additions & 2 deletions Analogy/CommonChangeLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ public static class CommonChangeLog
public static IEnumerable<AnalogyChangeLog> GetChangeLog()
{
return new List<AnalogyChangeLog>
{
new AnalogyChangeLog("Add ability to add notes to log messages. #217 ",AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2020,07,10)),
{
new AnalogyChangeLog("show open folder regardless of provider supplied folder. #229",AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2020,07,12)),
new AnalogyChangeLog("Add Support for reading compressed Zip files. #218",AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2020,07,11)),
new AnalogyChangeLog("Add ability to add notes to log messages. #217",AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2020,07,10)),
new AnalogyChangeLog("Shows AnalogyLogMessage's AdditionalInformation Properties in Detailed Window. #215",AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2020,07,10)),
new AnalogyChangeLog("System.ArgumentException when using the 'messages grouping' tab with a log file that contains custom columns. #225",AnalogChangeLogType.Bug,"Lior Banai",new DateTime(2020,07,10)),
new AnalogyChangeLog("Add providers icon to the ribbon page. #219",AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2020,07,09)),
Expand Down
65 changes: 30 additions & 35 deletions Analogy/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -915,35 +915,30 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
recentBar.RibbonStyle = RibbonItemStyles.All;

//local folder
if (offlineProviders.Any(i => !string.IsNullOrEmpty(i.InitialFolderFullPath) &&
Directory.Exists(i.InitialFolderFullPath)))
{
BarSubItem folderBar = new BarSubItem();
folderBar.Caption = "Open Folder";
folderBar.ImageOptions.Image = Resources.Open2_32x32;
folderBar.ImageOptions.LargeImage = Resources.Open2_32x32;
folderBar.RibbonStyle = RibbonItemStyles.All;
group.ItemLinks.Add(folderBar);

foreach (var dataProvider in offlineProviders)
{
BarSubItem folderBar = new BarSubItem();
folderBar.Caption = "Open Folder";
folderBar.ImageOptions.Image = Resources.Open2_32x32;
folderBar.ImageOptions.LargeImage = Resources.Open2_32x32;
folderBar.RibbonStyle = RibbonItemStyles.All;
group.ItemLinks.Add(folderBar);

//add local folder button:
if (!string.IsNullOrEmpty(dataProvider.InitialFolderFullPath) &&
Directory.Exists(dataProvider.InitialFolderFullPath))
{
BarButtonItem btn = new BarButtonItem { Caption = dataProvider.InitialFolderFullPath };
btn.ItemClick += (s, be) =>
{
OpenOffline(dataProvider.OptionalTitle, dataProvider,
dataProvider.InitialFolderFullPath);
};

folderBar.AddItem(btn);
}
}
foreach (var dataProvider in offlineProviders)
{
string directory = (!string.IsNullOrEmpty(dataProvider.InitialFolderFullPath) &&
Directory.Exists(dataProvider.InitialFolderFullPath))
? dataProvider.InitialFolderFullPath
: Environment.CurrentDirectory;
//add local folder button:
BarButtonItem btn = new BarButtonItem { Caption = directory };
btn.ItemClick += (s, be) =>
{
OpenOffline(dataProvider.OptionalTitle, dataProvider, directory);
};
folderBar.AddItem(btn);
}


//add recent folders
//recent bar
BarSubItem recentFolders = new BarSubItem { Caption = "Recent Folders" };
Expand Down Expand Up @@ -1216,16 +1211,16 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
}

//add local folder button:
if (!string.IsNullOrEmpty(offlineAnalogy.InitialFolderFullPath) &&
Directory.Exists(offlineAnalogy.InitialFolderFullPath))
{
BarButtonItem localfolder = new BarButtonItem();
localfolder.Caption = "Open Folder";
localfolder.RibbonStyle = RibbonItemStyles.All;
group.ItemLinks.Add(localfolder);
localfolder.ImageOptions.Image = Resources.Open2_32x32;
localfolder.ItemClick += (sender, e) => { OpenOffline(title, offlineAnalogy.InitialFolderFullPath); };
}
string directory = (!string.IsNullOrEmpty(offlineAnalogy.InitialFolderFullPath) &&
Directory.Exists(offlineAnalogy.InitialFolderFullPath))
? offlineAnalogy.InitialFolderFullPath
: Environment.CurrentDirectory;
BarButtonItem localfolder = new BarButtonItem();
localfolder.Caption = "Open Folder";
localfolder.RibbonStyle = RibbonItemStyles.All;
group.ItemLinks.Add(localfolder);
localfolder.ImageOptions.Image = Resources.Open2_32x32;
localfolder.ItemClick += (sender, e) => { OpenOffline(title, directory); };

//recent folder
//recent bar
Expand Down

0 comments on commit c509a17

Please sign in to comment.