Skip to content

Commit 0b8eba4

Browse files
committed
Code cleanup
1 parent ce2b863 commit 0b8eba4

File tree

102 files changed

+1217
-1217
lines changed

Some content is hidden

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

102 files changed

+1217
-1217
lines changed

ContextMenuManager/BluePointLilac.Controls/ControlExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Reflection;
1+
using System.Reflection;
32
using System.Windows.Forms;
43

54
namespace BluePointLilac.Controls

ContextMenuManager/BluePointLilac.Controls/DownloadDialog.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public override void Reset() { }
1616

1717
protected override bool RunDialog(IntPtr hwndOwner)
1818
{
19-
using(Process process = Process.GetCurrentProcess())
20-
using(DownloadForm frm = new DownloadForm())
19+
using (Process process = Process.GetCurrentProcess())
20+
using (DownloadForm frm = new DownloadForm())
2121
{
2222
frm.Url = Url;
2323
frm.Text = Text;
@@ -70,14 +70,14 @@ private void DownloadFile(string url, string filePath)
7070
{
7171
try
7272
{
73-
using(UAWebClient client = new UAWebClient())
73+
using (UAWebClient client = new UAWebClient())
7474
{
7575
client.DownloadProgressChanged += (sender, e) =>
7676
{
7777
int value = e.ProgressPercentage;
7878
Text = $"Downloading: {value}%";
7979
pgbDownload.Value = value;
80-
if(DialogResult == DialogResult.Cancel)
80+
if (DialogResult == DialogResult.Cancel)
8181
{
8282
client.CancelAsync();
8383
File.Delete(FilePath);
@@ -90,7 +90,7 @@ private void DownloadFile(string url, string filePath)
9090
client.DownloadFileAsync(new Uri(url), filePath);
9191
}
9292
}
93-
catch(Exception e)
93+
catch (Exception e)
9494
{
9595
MessageBox.Show(e.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
9696
DialogResult = DialogResult.Cancel;
@@ -99,8 +99,8 @@ private void DownloadFile(string url, string filePath)
9999

100100
protected override void OnLoad(EventArgs e)
101101
{
102-
if(Owner == null && Form.ActiveForm != this) Owner = Form.ActiveForm;
103-
if(Owner == null) StartPosition = FormStartPosition.CenterScreen;
102+
if (Owner == null && Form.ActiveForm != this) Owner = Form.ActiveForm;
103+
if (Owner == null) StartPosition = FormStartPosition.CenterScreen;
104104
else
105105
{
106106
TopMost = true;

ContextMenuManager/BluePointLilac.Controls/InputDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public override void Reset() { }
1717

1818
protected override bool RunDialog(IntPtr hwndOwner)
1919
{
20-
using(InputBox frm = new InputBox())
20+
using (InputBox frm = new InputBox())
2121
{
2222
frm.Text = Title;
2323
frm.InputedText = Text;

ContextMenuManager/BluePointLilac.Controls/MyListBox.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System;
33
using System.Collections.Generic;
44
using System.Drawing;
5-
using System.Linq;
65
using System.Windows.Forms;
76

87
namespace BluePointLilac.Controls

ContextMenuManager/BluePointLilac.Controls/MyMainForm.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ protected override void WndProc(ref Message m)
5858
const int SC_SIZE = 0xF000;
5959
const int HT_CAPTION = 0x2;
6060
bool suspend = false;//临时挂起MainBody
61-
switch(m.Msg)
61+
switch (m.Msg)
6262
{
6363
case WM_SYSCOMMAND:
64-
switch(m.WParam.ToInt32())
64+
switch (m.WParam.ToInt32())
6565
{
6666
//解决控件过多移动窗体时延迟问题
6767
case SC_MOVE:
@@ -76,15 +76,15 @@ protected override void WndProc(ref Message m)
7676
}
7777
break;
7878
case WM_NCLBUTTONDBLCLK:
79-
switch(m.WParam.ToInt32())
79+
switch (m.WParam.ToInt32())
8080
{
8181
//双击标题栏最大化和还原窗口
8282
case HT_CAPTION:
8383
suspend = SuspendMainBodyWhenResize; break;
8484
}
8585
break;
8686
}
87-
if(suspend)
87+
if (suspend)
8888
{
8989
SuspendLayout();
9090
MainBody.SuspendLayout();

ContextMenuManager/BluePointLilac.Controls/PictureButton.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.ComponentModel;
32
using System.Drawing;
43
using System.Drawing.Imaging;
54
using System.Windows.Forms;

ContextMenuManager/BluePointLilac.Controls/ReadOnlyTextBox.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ReadOnlyTextBox()
2222
const int WM_KILLFOCUS = 0x0008;
2323
protected override void WndProc(ref Message m)
2424
{
25-
switch(m.Msg)
25+
switch (m.Msg)
2626
{
2727
case WM_SETFOCUS:
2828
m.Msg = WM_KILLFOCUS; break;
@@ -35,7 +35,7 @@ protected override void WndProc(ref Message m)
3535
protected override void OnMouseEnter(EventArgs e)
3636
{
3737
base.OnMouseEnter(e);
38-
if(firstEnter) Focus();
38+
if (firstEnter) Focus();
3939
firstEnter = false;
4040
}
4141
}
@@ -58,7 +58,7 @@ public ReadOnlyRichTextBox()
5858

5959
protected override void WndProc(ref Message m)
6060
{
61-
switch(m.Msg)
61+
switch (m.Msg)
6262
{
6363
case WM_SETFOCUS:
6464
m.Msg = WM_KILLFOCUS; break;
@@ -71,7 +71,7 @@ protected override void WndProc(ref Message m)
7171
protected override void OnMouseEnter(EventArgs e)
7272
{
7373
base.OnMouseEnter(e);
74-
if(firstEnter) Focus();
74+
if (firstEnter) Focus();
7575
firstEnter = false;
7676
}
7777

ContextMenuManager/BluePointLilac.Controls/ResizeLimitedForm.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ public ResizeLimitedForm()
2020
protected override void WndProc(ref Message m)
2121
{
2222
base.WndProc(ref m);
23-
if(m.Msg == WM_NCHITTEST && WindowState == FormWindowState.Normal)
23+
if (m.Msg == WM_NCHITTEST && WindowState == FormWindowState.Normal)
2424
{
2525
IntPtr hNowhere = new IntPtr((int)HitTest.Nowhere);
26-
switch((HitTest)m.Result)
26+
switch ((HitTest)m.Result)
2727
{
2828
case HitTest.Top:
2929
case HitTest.Bottom:
30-
if(!VerticalResizable) m.Result = hNowhere;
30+
if (!VerticalResizable) m.Result = hNowhere;
3131
break;
3232
case HitTest.Left:
3333
case HitTest.Right:
34-
if(!HorizontalResizable) m.Result = hNowhere;
34+
if (!HorizontalResizable) m.Result = hNowhere;
3535
break;
3636
case HitTest.TopLeft:
3737
case HitTest.TopRight:
3838
case HitTest.BottomLeft:
3939
case HitTest.BottomRight:
40-
if(!VerticalResizable || !HorizontalResizable) m.Result = hNowhere;
40+
if (!VerticalResizable || !HorizontalResizable) m.Result = hNowhere;
4141
break;
4242
}
4343
}

ContextMenuManager/BluePointLilac.Controls/SearchBox.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using System;
1+
using BluePointLilac.Methods;
2+
using ContextMenuManager.Methods;
3+
using Svg;
4+
using System;
25
using System.Drawing;
36
using System.Drawing.Drawing2D;
47
using System.Drawing.Imaging;
58
using System.Windows.Forms;
6-
using BluePointLilac.Methods;
7-
using ContextMenuManager.Methods;
8-
using Svg;
99

1010
namespace BluePointLilac.Controls
1111
{

ContextMenuManager/BluePointLilac.Controls/SelectDialog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ public override void Reset() { }
1717

1818
protected override bool RunDialog(IntPtr hwndOwner)
1919
{
20-
using(SelectForm frm = new SelectForm())
20+
using (SelectForm frm = new SelectForm())
2121
{
2222
frm.Text = Title;
2323
frm.Items = Items;
24-
if(Selected != null) frm.Selected = Selected;
24+
if (Selected != null) frm.Selected = Selected;
2525
else frm.SelectedIndex = SelectedIndex;
2626
frm.CanEdit = CanEdit;
2727
if (Control.FromHandle(hwndOwner) is Form owner) frm.TopMost = true;
2828
bool flag = frm.ShowDialog() == DialogResult.OK;
29-
if(flag)
29+
if (flag)
3030
{
3131
Selected = frm.Selected;
3232
SelectedIndex = frm.SelectedIndex;

0 commit comments

Comments
 (0)