* 编译SunnyUI.Demo为VS2010可编译版本。

This commit is contained in:
Sunny 2022-03-29 14:48:30 +08:00
parent f6cbae9c2e
commit 6e74517f3f
7 changed files with 33 additions and 25 deletions

Binary file not shown.

23
SunnyUI.Demo.sln Normal file
View File

@ -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

Binary file not shown.

View File

@ -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

View File

@ -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;
}
}

View File

@ -91,11 +91,13 @@ namespace Sunny.UI.Demo
//根据页面类型获取页面
FButton page = GetPage<FButton>();
page?.Text.WriteConsole();
if (page != null)
page.Text.WriteConsole();
//根据页面索引获取页面
UIPage page1 = GetPage(1002);
page1?.Text.WriteConsole();
if (page1 != null)
page1.Text.WriteConsole();
}
/// <summary>
@ -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)

View File

@ -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<string>() { "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<string> 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; }