diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index 179b30c1..11b95c75 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/SunnyUI.Demo.sln b/SunnyUI.Demo.sln new file mode 100644 index 00000000..df4086ba --- /dev/null +++ b/SunnyUI.Demo.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SunnyUI.Demo", "SunnyUI.Demo\SunnyUI.Demo.csproj", "{6AE19B87-C2AA-4C56-BC26-1C343F30FF58}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6AE19B87-C2AA-4C56-BC26-1C343F30FF58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6AE19B87-C2AA-4C56-BC26-1C343F30FF58}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6AE19B87-C2AA-4C56-BC26-1C343F30FF58}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6AE19B87-C2AA-4C56-BC26-1C343F30FF58}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6A916817-9F8C-4A1B-87CA-7DFD5453C40A} + EndGlobalSection +EndGlobal diff --git a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe index b9fa45d1..79311e88 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe and b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe differ diff --git a/SunnyUI.Demo/Controls/FCombobox.cs b/SunnyUI.Demo/Controls/FCombobox.cs index f18acca9..8646dbb1 100644 --- a/SunnyUI.Demo/Controls/FCombobox.cs +++ b/SunnyUI.Demo/Controls/FCombobox.cs @@ -108,8 +108,9 @@ namespace Sunny.UI.Demo private void uiComboDataGridView1_ValueChanged(object sender, object value) { - if (value is DataGridViewRow row) + if (value is DataGridViewRow) { + DataGridViewRow row = (DataGridViewRow)value; uiComboDataGridView1.Text = row.Cells["Column1"].Value.ToString(); } else diff --git a/SunnyUI.Demo/Controls/FContextMenuStrip.cs b/SunnyUI.Demo/Controls/FContextMenuStrip.cs index 77c5434f..37745e63 100644 --- a/SunnyUI.Demo/Controls/FContextMenuStrip.cs +++ b/SunnyUI.Demo/Controls/FContextMenuStrip.cs @@ -21,8 +21,9 @@ namespace Sunny.UI.Demo private void Item_Click(object sender, EventArgs e) { ToolStripMenuItem item = (ToolStripMenuItem)sender; - if (item.Tag != null && item.Tag is UIStyle style) + if (item.Tag != null && item.Tag is UIStyle) { + UIStyle style = (UIStyle)item.Tag; this.Style = style; } } diff --git a/SunnyUI.Demo/FMain.cs b/SunnyUI.Demo/FMain.cs index 2208b63a..d2e64189 100644 --- a/SunnyUI.Demo/FMain.cs +++ b/SunnyUI.Demo/FMain.cs @@ -91,11 +91,13 @@ namespace Sunny.UI.Demo //根据页面类型获取页面 FButton page = GetPage(); - page?.Text.WriteConsole(); + if (page != null) + page.Text.WriteConsole(); //根据页面索引获取页面 UIPage page1 = GetPage(1002); - page1?.Text.WriteConsole(); + if (page1 != null) + page1.Text.WriteConsole(); } /// @@ -131,7 +133,8 @@ namespace Sunny.UI.Demo private void FMain_Selecting(object sender, TabControlCancelEventArgs e, UIPage page) { - Console.WriteLine(page?.Text); + if (page != null) + Console.WriteLine(page.Text); } private void 关于ToolStripMenuItem1_Click(object sender, EventArgs e) diff --git a/SunnyUI.Demo/Units/UMapperDemo.cs b/SunnyUI.Demo/Units/UMapperDemo.cs index 1734d5a5..17bfd720 100644 --- a/SunnyUI.Demo/Units/UMapperDemo.cs +++ b/SunnyUI.Demo/Units/UMapperDemo.cs @@ -14,7 +14,6 @@ namespace Sunny.UI.Demo t1.C = 768; t1.D = DateTime.Now; t1.E = new Point(100, 200); - t1.F = new MapperT3("Struct String", '\n', new MapperT4("I am T4")); t1.G = new Size(100, 200); t1.H = new List() { "AA", "BB" }; t1.I = new string[2] { "AA", "BB" }; @@ -38,8 +37,6 @@ namespace Sunny.UI.Demo public Point E { get; set; } - public MapperT3 F { get; set; } - public Size G { get; set; } public List H { get; set; } @@ -59,8 +56,6 @@ namespace Sunny.UI.Demo public Point E { get; set; } - public MapperT3 F { get; set; } - [MapperIgnore] public Size G { get; set; } @@ -69,21 +64,6 @@ namespace Sunny.UI.Demo public string[] I { get; set; } } - public struct MapperT3 - { - public string String { get; set; } - public char Char { get; set; } - - public MapperT4 T4 { get; set; } - - public MapperT3(string str, char c, MapperT4 t4) - { - String = str; - Char = c; - T4 = t4; - } - } - public class MapperT4 { public string String { get; set; }