Skip to content

Commit 350f6b9

Browse files
authored
Added editorconfig file (#196)
1 parent 01ddbab commit 350f6b9

File tree

12 files changed

+39
-37
lines changed

12 files changed

+39
-37
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; Top-most EditorConfig file
2+
root = true
3+
4+
; Unix-style newlines
5+
[*]
6+
end_of_line = crlf
7+
8+
; 4-column space indentation
9+
[*.cs]
10+
indent_style = space
11+
indent_size = 4
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
15+
# .NET formatting rules
16+
[*.{cs,vb}]
17+
dotnet_sort_system_directives_first = true

NLog.Windows.Forms.Tests/ApiTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
namespace NLog.Windows.Forms.Tests
22
{
33
using System;
4-
using System.Linq;
5-
using System.Text;
64
using System.Collections.Generic;
5+
using System.Linq;
76
using System.Reflection;
7+
using System.Text;
88
using NLog.Config;
99
using NLog.LayoutRenderers;
1010
using Xunit;

NLog.Windows.Forms.Tests/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Reflection;
2-
using System.Runtime.CompilerServices;
3-
using System.Runtime.InteropServices;
1+
using System.Runtime.InteropServices;
42

53
// Setting ComVisible to false makes the types in this assembly not visible
64
// to COM components. If you need to access a type in this assembly from

NLog.Windows.Forms.Tests/RichTextBoxTargetTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System.Drawing;
1+
using System;
2+
using System.Drawing;
23
using System.IO;
34
using System.Text;
5+
using System.Threading;
6+
using System.Threading.Tasks;
47
using System.Windows.Forms;
58
using NLog.Config;
69
using Xunit;
7-
using System;
8-
using System.Threading.Tasks;
9-
using System.Threading;
1010

1111
namespace NLog.Windows.Forms.Tests
1212
{

NLog.Windows.Forms.Tests/ToolStripItemTargetTests.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using NLog.Config;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
7-
using System.Windows.Forms;
1+
using System.Windows.Forms;
82
using Xunit;
93

104
namespace NLog.Windows.Forms.Tests
@@ -54,23 +48,23 @@ public void SimpleToolStripItemTargetTest()
5448
logger.Fatal("Test"); // Send log
5549
Application.DoEvents(); // Do events to allow the invoked method is completed.
5650
Assert.Equal("Fatal NLog.UnitTests.Targets.ToolStripItemTargetTests Test", testItem.Text); // Test if method worked.
57-
51+
5852
logger.Error("Foo");
5953
Application.DoEvents();
6054
Assert.Equal("Error NLog.UnitTests.Targets.ToolStripItemTargetTests Foo", testItem.Text);
61-
55+
6256
logger.Warn("Bar");
6357
Application.DoEvents();
6458
Assert.Equal("Warn NLog.UnitTests.Targets.ToolStripItemTargetTests Bar", testItem.Text);
65-
59+
6660
logger.Info("Test");
6761
Application.DoEvents();
6862
Assert.Equal("Info NLog.UnitTests.Targets.ToolStripItemTargetTests Test", testItem.Text);
69-
63+
7064
logger.Debug("Foo");
7165
Application.DoEvents();
7266
Assert.Equal("Debug NLog.UnitTests.Targets.ToolStripItemTargetTests Foo", testItem.Text);
73-
67+
7468
logger.Trace("Bar");
7569
Application.DoEvents();
7670
Assert.Equal("Trace NLog.UnitTests.Targets.ToolStripItemTargetTests Bar", testItem.Text);

NLog.Windows.Forms/FormHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ internal static void ChangeSelectionToLink(RichTextBox textBox, string text, str
201201

202202
//using \v tag to hide hyperlink part of the text, and \v0 to end hiding. See http://stackoverflow.com/a/14339531/376066
203203
//so in the control the link would consist only of "<text>", but in link clicked event we would get "<text>#<hyperlink>"
204-
textBox.SelectedRtf = @"{\rtf1\ansi " + text + @"\v #" + hyperlink + @"\v0}";
204+
textBox.SelectedRtf = @"{\rtf1\ansi " + text + @"\v #" + hyperlink + @"\v0}";
205205

206206
textBox.Select(selectionStart, text.Length + 1 + hyperlink.Length); //now select both visible and invisible part
207207
SetSelectionStyle(textBox, CFM_LINK, CFE_LINK); //and turn into a link
@@ -276,6 +276,6 @@ private struct CHARFORMAT2_STRUCT
276276
[DllImport("user32.dll", CharSet = CharSet.Auto)]
277277
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
278278
#endif
279-
#endregion
279+
#endregion
280280
}
281-
}
281+
}

NLog.Windows.Forms/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Reflection;
2-
using System.Runtime.CompilerServices;
1+
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// Setting ComVisible to false makes the types in this assembly not visible
@@ -11,4 +10,4 @@
1110
[assembly: Guid("311cbf4d-0b45-49bc-ad1b-fd113f152066")]
1211

1312
//Unit tests
14-
[assembly: InternalsVisibleTo("NLog.Windows.Forms.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100772391e63c104728adcf18e2390474262559fa7f34a4215848f43288cde875dcc92a06222e9be0592b211ff74adbb5d21a7aab5522b540b1735f2f03279221056fedbe7e534073dabee9db48f8ecebcf1dc98a95576e45cbeff5fe7c4842859451ab2dae7a8370f1b2f7a529d2ca210e3e844d973523d73d193df6c17f1314a6")]
13+
[assembly: InternalsVisibleTo("NLog.Windows.Forms.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100772391e63c104728adcf18e2390474262559fa7f34a4215848f43288cde875dcc92a06222e9be0592b211ff74adbb5d21a7aab5522b540b1735f2f03279221056fedbe7e534073dabee9db48f8ecebcf1dc98a95576e45cbeff5fe7c4842859451ab2dae7a8370f1b2f7a529d2ca210e3e844d973523d73d193df6c17f1314a6")]

NLog.Windows.Forms/RichTextBoxTarget.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public bool SupportLinks
416416
/// <seealso cref="DelLinkClicked"/>
417417
/// </summary>
418418
public event DelLinkClicked? LinkClicked;
419-
419+
420420
/// <summary>
421421
/// Actual value of the <see cref="LinkClicked"/> property
422422
/// </summary>

NLog.Windows.Forms/RichTextBoxTargetMessageRetentionStrategy.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.Linq;
3-
4-
namespace NLog.Windows.Forms
1+
namespace NLog.Windows.Forms
52
{
63
/// <summary>
74
/// How to handle messages when switching between target controls or no control is attached at all

TestApplications/TestApplication.Shared/Form1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public Form1()
2020
logger.Info("Init {Application}", file);
2121

2222
RichTextBoxTarget.ReInitializeAllTextboxes(this);
23-
23+
2424

2525
logger.Log(LogLevel.Trace, "Log Trace");
2626
logger.Log(LogLevel.Debug, "Log Debug");

0 commit comments

Comments
 (0)