Skip to content

Commit fe517cc

Browse files
committed
WIP: Added custom file receiver
- Started adding a reciever for any kind of log message. - Fixed various issues
1 parent 5faa60d commit fe517cc

File tree

71 files changed

+4810
-378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4810
-378
lines changed

src/GuiLibrary/Controls/ColorDropDown.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ public void SetCustomColor(Color color)
237237
{
238238
((ColorInfo)Items[Items.Count - 1]).Color = color;
239239
}
240+
241+
Invalidate();
240242
}
241243

242244
#endregion
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#region Copyright © 2016 Couchcoding
2+
3+
// File: CustomToolStripSystemRenderer.cs
4+
// Package: GuiLibrary
5+
// Project: Logbert
6+
//
7+
// The MIT License (MIT)
8+
//
9+
// Copyright (c) 2016 Couchcoding
10+
//
11+
// Permission is hereby granted, free of charge, to any person obtaining a copy
12+
// of this software and associated documentation files (the "Software"), to deal
13+
// in the Software without restriction, including without limitation the rights
14+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
// copies of the Software, and to permit persons to whom the Software is
16+
// furnished to do so, subject to the following conditions:
17+
//
18+
// The above copyright notice and this permission notice shall be included in
19+
// all copies or substantial portions of the Software.
20+
//
21+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27+
// THE SOFTWARE.
28+
29+
#endregion
30+
31+
using System.Windows.Forms;
32+
33+
namespace Com.Couchcoding.GuiLibrary.Controls
34+
{
35+
/// <summary>
36+
/// Implements a custom <see cref="ToolStripSystemRenderer"/> control.
37+
/// </summary>
38+
public sealed class CustomToolStripSystemRenderer : ToolStripSystemRenderer
39+
{
40+
#region Private Methods
41+
42+
/// <summary>
43+
/// Raises the RenderToolStripBorder event.
44+
/// </summary>
45+
/// <param name="e">A <see cref="ToolStripRenderEventArgs"/> that contains the event data.</param>
46+
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
47+
{
48+
// Don't draw the toolstrip border.
49+
}
50+
51+
#endregion
52+
}
53+
}

src/GuiLibrary/Dialogs/DialogForm.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,17 @@ public virtual bool ShowFooterArea
323323

324324
#region Private Methods
325325

326+
/// <summary>
327+
/// Validates the dialog inputs before the dialog is closed.
328+
/// </summary>
329+
/// <param name="dlgResult">The current active <see cref="DialogResult"/>.</param>
330+
/// <returns><c>True</c> if all input is valid; otherwise <c>false</c>.</returns>
331+
protected virtual bool ValidateDialog(DialogResult dlgResult)
332+
{
333+
// By default everything is valid.
334+
return true;
335+
}
336+
326337
/// <summary>
327338
/// Recalculates the Padding depending on the DPI setings.
328339
/// </summary>
@@ -474,6 +485,24 @@ protected override void OnPaint(PaintEventArgs e)
474485
DrawDialogBackground(e.Graphics);
475486
}
476487

488+
/// <summary>
489+
/// Raises the <see cref="E:System.Windows.Forms.Form.Closing"/> event.
490+
/// </summary>
491+
/// <param name="e">A <see cref="T:System.ComponentModel.CancelEventArgs"/> that contains the event data. </param>
492+
protected override void OnClosing(CancelEventArgs e)
493+
{
494+
// Prevent the dialog from closing if at least one dialog input is invalid.
495+
e.Cancel = !ValidateDialog(DialogResult);
496+
497+
base.OnClosing(e);
498+
499+
if (Owner != null)
500+
{
501+
// Focus the owning window.
502+
Owner.Activate();
503+
}
504+
}
505+
477506
#endregion
478507

479508
#region Constructor

src/GuiLibrary/GuiLibrary.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<Compile Include="Controls\ColorDropDown.cs">
6363
<SubType>Component</SubType>
6464
</Compile>
65+
<Compile Include="Controls\CustomToolStripSystemRenderer.cs" />
6566
<Compile Include="Controls\DataGridViewEx.cs">
6667
<SubType>Component</SubType>
6768
</Compile>

src/Logbert.sln

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.23107.0
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.40629.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logbert", "Logbert\Logbert.csproj", "{EE81C506-55E4-417E-B1D6-09453F89C7CD}"
77
EndProject
@@ -17,81 +17,23 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Logbert Setup", "Logbert Se
1717
EndProject
1818
Global
1919
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20-
CodeAnalysisDebug|Any CPU = CodeAnalysisDebug|Any CPU
21-
CodeAnalysisDebug|Mixed Platforms = CodeAnalysisDebug|Mixed Platforms
22-
CodeAnalysisDebug|x86 = CodeAnalysisDebug|x86
23-
Debug|Any CPU = Debug|Any CPU
24-
Debug|Mixed Platforms = Debug|Mixed Platforms
2520
Debug|x86 = Debug|x86
26-
Release|Any CPU = Release|Any CPU
27-
Release|Mixed Platforms = Release|Mixed Platforms
2821
Release|x86 = Release|x86
2922
EndGlobalSection
3023
GlobalSection(ProjectConfigurationPlatforms) = postSolution
31-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.CodeAnalysisDebug|Any CPU.ActiveCfg = Debug|Any CPU
32-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.CodeAnalysisDebug|Any CPU.Build.0 = Debug|Any CPU
33-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.CodeAnalysisDebug|Mixed Platforms.ActiveCfg = Debug|x86
34-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.CodeAnalysisDebug|Mixed Platforms.Build.0 = Debug|x86
35-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.CodeAnalysisDebug|x86.ActiveCfg = Debug|x86
36-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.CodeAnalysisDebug|x86.Build.0 = Debug|x86
37-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Debug|Any CPU.ActiveCfg = Debug|x86
38-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Debug|Any CPU.Build.0 = Debug|x86
39-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
40-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Debug|Mixed Platforms.Build.0 = Debug|x86
4124
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Debug|x86.ActiveCfg = Debug|x86
4225
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Debug|x86.Build.0 = Debug|x86
43-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Release|Any CPU.ActiveCfg = Release|x86
44-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Release|Any CPU.Build.0 = Release|x86
45-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Release|Mixed Platforms.ActiveCfg = Release|x86
46-
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Release|Mixed Platforms.Build.0 = Release|x86
4726
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Release|x86.ActiveCfg = Release|x86
4827
{EE81C506-55E4-417E-B1D6-09453F89C7CD}.Release|x86.Build.0 = Release|x86
49-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.CodeAnalysisDebug|Any CPU.ActiveCfg = Debug|Any CPU
50-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.CodeAnalysisDebug|Any CPU.Build.0 = Debug|Any CPU
51-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.CodeAnalysisDebug|Mixed Platforms.ActiveCfg = Debug|Any CPU
52-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.CodeAnalysisDebug|Mixed Platforms.Build.0 = Debug|Any CPU
53-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.CodeAnalysisDebug|x86.ActiveCfg = Debug|Any CPU
54-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
56-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
57-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Mixed Platforms.Build.0 = Debug|x86
5828
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|x86.ActiveCfg = Debug|x86
5929
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|x86.Build.0 = Debug|x86
60-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
61-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.Build.0 = Release|Any CPU
62-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Mixed Platforms.ActiveCfg = Release|x86
63-
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Mixed Platforms.Build.0 = Release|x86
6430
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|x86.ActiveCfg = Release|x86
6531
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|x86.Build.0 = Release|x86
66-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.CodeAnalysisDebug|Any CPU.ActiveCfg = Debug|Any CPU
67-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.CodeAnalysisDebug|Any CPU.Build.0 = Debug|Any CPU
68-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.CodeAnalysisDebug|Mixed Platforms.ActiveCfg = Debug|x86
69-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.CodeAnalysisDebug|Mixed Platforms.Build.0 = Debug|x86
70-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.CodeAnalysisDebug|x86.ActiveCfg = Debug|x86
71-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.CodeAnalysisDebug|x86.Build.0 = Debug|x86
72-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Debug|Any CPU.ActiveCfg = Debug|x86
73-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Debug|Any CPU.Build.0 = Debug|x86
74-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
75-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Debug|Mixed Platforms.Build.0 = Debug|x86
7632
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Debug|x86.ActiveCfg = Debug|x86
7733
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Debug|x86.Build.0 = Debug|x86
78-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Release|Any CPU.ActiveCfg = Release|x86
79-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Release|Any CPU.Build.0 = Release|x86
80-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Release|Mixed Platforms.ActiveCfg = Release|x86
81-
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Release|Mixed Platforms.Build.0 = Release|x86
8234
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Release|x86.ActiveCfg = Release|x86
8335
{0D9D135F-9D7A-4D90-8810-903450FD4245}.Release|x86.Build.0 = Release|x86
84-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.CodeAnalysisDebug|Any CPU.ActiveCfg = Debug|x86
85-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.CodeAnalysisDebug|Mixed Platforms.ActiveCfg = Debug|x86
86-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.CodeAnalysisDebug|Mixed Platforms.Build.0 = Debug|x86
87-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.CodeAnalysisDebug|x86.ActiveCfg = Debug|x86
88-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.CodeAnalysisDebug|x86.Build.0 = Debug|x86
89-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.Debug|Any CPU.ActiveCfg = Debug|x86
90-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
9136
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.Debug|x86.ActiveCfg = Debug|x86
92-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.Release|Any CPU.ActiveCfg = Release|x86
93-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.Release|Mixed Platforms.ActiveCfg = Release|x86
94-
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.Release|Mixed Platforms.Build.0 = Release|x86
9537
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.Release|x86.ActiveCfg = Release|x86
9638
{8C408EBB-DDB3-4217-BB6B-AF6584A13F4B}.Release|x86.Build.0 = Release|x86
9739
EndGlobalSection

src/Logbert/App.config

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
77
<section name="Com.Couchcoding.Logbert.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
88
</sectionGroup>
9+
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
10+
<section name="Com.Couchcoding.Logbert.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
11+
</sectionGroup>
912
</configSections>
1013
<appSettings>
1114
<!-- To enable internal log4net logging specify the following appSettings key -->
@@ -91,7 +94,7 @@
9194
<value>Microsoft Sans Serif</value>
9295
</setting>
9396
<setting name="LogMessagesFontSize" serializeAs="String">
94-
<value>8.25</value>
97+
<value>9</value>
9598
</setting>
9699
<setting name="FrmFindSearchMatchCase" serializeAs="String">
97100
<value>False</value>
@@ -297,6 +300,52 @@
297300
<setting name="PnlNLogFileSettingsStartFromBeginning" serializeAs="String">
298301
<value>True</value>
299302
</setting>
303+
<setting name="PnlCustomFileSettingsFile" serializeAs="String">
304+
<value />
305+
</setting>
306+
<setting name="PnlCustomFileSettingsStartFromBeginning" serializeAs="String">
307+
<value>True</value>
308+
</setting>
309+
<setting name="PnlCustomFileSettingsColumnizer" serializeAs="String">
310+
<value />
311+
</setting>
312+
<setting name="MaxLogMessages" serializeAs="String">
313+
<value>1000000</value>
314+
</setting>
315+
<setting name="DockLayoutCustomReceiver" serializeAs="String">
316+
<value />
317+
</setting>
318+
<setting name="DockLayoutEventlogReceiver" serializeAs="String">
319+
<value />
320+
</setting>
321+
<setting name="DockLayoutLog4NetFileReceiver" serializeAs="String">
322+
<value />
323+
</setting>
324+
<setting name="DockLayoutLog4NetUdpReceiver" serializeAs="String">
325+
<value />
326+
</setting>
327+
<setting name="DockLayoutNLogFileReceiver" serializeAs="String">
328+
<value />
329+
</setting>
330+
<setting name="DockLayoutNLogTcpReceiver" serializeAs="String">
331+
<value />
332+
</setting>
333+
<setting name="DockLayoutNLogUdpReceiver" serializeAs="String">
334+
<value />
335+
</setting>
336+
<setting name="DockLayoutSyslogFileReceiver" serializeAs="String">
337+
<value />
338+
</setting>
339+
<setting name="DockLayoutSyslogUdpReceiver" serializeAs="String">
340+
<value />
341+
</setting>
300342
</Com.Couchcoding.Logbert.Properties.Settings>
301343
</userSettings>
344+
<applicationSettings>
345+
<Com.Couchcoding.Logbert.Properties.Settings>
346+
<setting name="ColumnizerRepository" serializeAs="String">
347+
<value>columnizer.xml</value>
348+
</setting>
349+
</Com.Couchcoding.Logbert.Properties.Settings>
350+
</applicationSettings>
302351
</configuration>

src/Logbert/Controls/ColorPickerCtrl.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@
112112
<value>2.0</value>
113113
</resheader>
114114
<resheader name="reader">
115-
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116116
</resheader>
117117
<resheader name="writer">
118-
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<metadata name="tltTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
120+
<metadata name="tltTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121121
<value>17, 17</value>
122122
</metadata>
123123
</root>

src/Logbert/Controls/EventLogDetailsControl.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ public partial class EventLogDetailsControl : UserControl, ILogPresenter
7272

7373
#region Public Properties
7474

75+
/// <summary>
76+
/// Gets the count of currently displayed <see cref=LogMessage"/>s.
77+
/// </summary>
78+
public int DisplayedLogMessagesCount
79+
{
80+
get
81+
{
82+
return 0;
83+
}
84+
}
85+
7586
/// <summary>
7687
/// Gets or sets the font of the text displayed by the control.
7788
/// </summary>

src/Logbert/Controls/Log4NetDetailsControl.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ public partial class Log4NetDetailsControl : UserControl, ILogPresenter
7272

7373
#region Public Properties
7474

75+
/// <summary>
76+
/// Gets the count of currently displayed <see cref=LogMessage"/>s.
77+
/// </summary>
78+
public int DisplayedLogMessagesCount
79+
{
80+
get
81+
{
82+
return 0;
83+
}
84+
}
85+
7586
/// <summary>
7687
/// Gets or sets the font of the text displayed by the control.
7788
/// </summary>

src/Logbert/Controls/OptionPanels/OptionPanelGeneral.Designer.cs

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

0 commit comments

Comments
 (0)