Skip to content

Commit 425519d

Browse files
committed
Fixed persistent layout and added link to website
1 parent b5bbc55 commit 425519d

File tree

14 files changed

+85
-10
lines changed

14 files changed

+85
-10
lines changed

src/Logbert/MainForm.Designer.cs

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Logbert/MainForm.cs

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@
4848
using System.Text;
4949

5050
using Com.Couchcoding.Logbert.Receiver;
51-
using System.Collections.Specialized;
5251

5352
namespace Logbert
5453
{
5554
public partial class MainForm : Form, ISearchable
5655
{
56+
#region Private Consts
57+
58+
private const string LOGBERT_HOMEPAGE_URI = @"https://github.com/couchcoding/Logbert/";
59+
60+
#endregion
61+
5762
#region Private Fields
5863

5964
/// <summary>
@@ -98,6 +103,41 @@ public sealed override Font Font
98103

99104
#region Private Methods
100105

106+
private void MnuMainHomepageClick(object sender, EventArgs e)
107+
{
108+
try
109+
{
110+
System.Diagnostics.Process.Start(LOGBERT_HOMEPAGE_URI);
111+
}
112+
catch (Exception ex1)
113+
{
114+
// System.ComponentModel.Win32Exception is a known exception that occurs when Firefox is default browser.
115+
// It actually opens the browser but STILL throws this exception so we can just ignore it. If not this exception,
116+
// then attempt to open the URL in IE instead.
117+
if (ex1.GetType().ToString() != "System.ComponentModel.Win32Exception")
118+
{
119+
// Sometimes throws exception so we have to just ignore.
120+
// This is a common .NET issue that no one online really has a great reason for so now we just need to try to open the URL using IE if we can.
121+
try
122+
{
123+
System.Diagnostics.ProcessStartInfo startInfo =
124+
new System.Diagnostics.ProcessStartInfo("IExplore.exe", LOGBERT_HOMEPAGE_URI);
125+
126+
System.Diagnostics.Process.Start(startInfo);
127+
}
128+
catch
129+
{
130+
MessageBox.Show(
131+
this
132+
, string.Format(Resources.strMainUnableToOpenUri, LOGBERT_HOMEPAGE_URI)
133+
, Application.ProductName
134+
, MessageBoxButtons.OK
135+
, MessageBoxIcon.Error);
136+
}
137+
}
138+
}
139+
}
140+
101141
private void MnuMainHelpAboutClick(object sender, EventArgs e)
102142
{
103143
using (FrmAbout aboutDlg = new FrmAbout())
@@ -212,11 +252,6 @@ private void MainDockPanelContentRemoved(object sender, DockContentEventArgs e)
212252
{
213253
if (Disposing)
214254
{
215-
if (e.Content != null && e.Content.DockHandler != null)
216-
{
217-
e.Content.DockHandler.Close();
218-
}
219-
220255
return;
221256
}
222257

src/Logbert/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
// Build Number
3030
// Revision
3131
//
32-
[assembly: AssemblyVersion("1.2.0.0")]
33-
[assembly: AssemblyFileVersion("1.2.0.0")]
32+
[assembly: AssemblyVersion("1.2.0.1")]
33+
[assembly: AssemblyFileVersion("1.2.0.1")]
3434
[assembly: NeutralResourcesLanguageAttribute("")]

src/Logbert/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Logbert/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,4 +674,7 @@ end</value>
674674
<data name="FrmStatisticShowLegend" type="System.Resources.ResXFileRef, System.Windows.Forms">
675675
<value>..\Resources\FrmStatisticShowLegend.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
676676
</data>
677+
<data name="strMainUnableToOpenUri" xml:space="preserve">
678+
<value>The Logbert Homepage could not be opened. Please open your browser and navigate to "{0}".</value>
679+
</data>
677680
</root>

src/Logbert/Receiver/CustomReceiver/CustomFileReceiver/CustomFileReceiver.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030

3131
using System.Collections.Generic;
3232
using System.IO;
33-
33+
using System.Windows.Forms;
34+
using Com.Couchcoding.Logbert.Helper;
3435
using Com.Couchcoding.Logbert.Interfaces;
3536
using Com.Couchcoding.Logbert.Logging;
3637

@@ -393,6 +394,7 @@ public override void Shutdown()
393394
public override void SaveLayout(string layout)
394395
{
395396
Properties.Settings.Default.DockLayoutCustomReceiver = layout ?? string.Empty;
397+
Properties.Settings.Default.SaveSettings();
396398
}
397399

398400
/// <summary>

src/Logbert/Receiver/EventlogReceiver/EventlogReceiver.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ public override void Clear()
290290
public override void SaveLayout(string layout)
291291
{
292292
Properties.Settings.Default.DockLayoutEventlogReceiver = layout ?? string.Empty;
293+
Properties.Settings.Default.SaveSettings();
293294
}
294295

295296
/// <summary>

src/Logbert/Receiver/Log4NetFileReceiver/Log4NetFileReceiver.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ public override bool CanHandleLogFile()
439439
public override void SaveLayout(string layout)
440440
{
441441
Properties.Settings.Default.DockLayoutLog4NetFileReceiver = layout ?? string.Empty;
442+
Properties.Settings.Default.SaveSettings();
442443
}
443444

444445
/// <summary>

src/Logbert/Receiver/Log4NetUdpReceiver/Log4NetUdpReceiver.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ public override void Clear()
372372
public override void SaveLayout(string layout)
373373
{
374374
Properties.Settings.Default.DockLayoutLog4NetUdpReceiver = layout ?? string.Empty;
375+
Properties.Settings.Default.SaveSettings();
375376
}
376377

377378
/// <summary>

src/Logbert/Receiver/NLogFileReceiver/NLogFileReceiver.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ public override bool CanHandleLogFile()
438438
public override void SaveLayout(string layout)
439439
{
440440
Properties.Settings.Default.DockLayoutNLogFileReceiver = layout ?? string.Empty;
441+
Properties.Settings.Default.SaveSettings();
441442
}
442443

443444
/// <summary>

0 commit comments

Comments
 (0)