mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2024-10-16 23:06:49 +03:00
Created project
This commit is contained in:
parent
3a9b91041f
commit
62c6fce171
28
DarkUI.sln
Normal file
28
DarkUI.sln
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DarkUI", "DarkUI\DarkUI.csproj", "{F19472F5-8C44-4C51-A8A0-B9DE5F555255}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "Example\Example.csproj", "{FA334815-6D78-4E9A-9F4D-6C8A58222A57}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F19472F5-8C44-4C51-A8A0-B9DE5F555255}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F19472F5-8C44-4C51-A8A0-B9DE5F555255}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F19472F5-8C44-4C51-A8A0-B9DE5F555255}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F19472F5-8C44-4C51-A8A0-B9DE5F555255}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FA334815-6D78-4E9A-9F4D-6C8A58222A57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FA334815-6D78-4E9A-9F4D-6C8A58222A57}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FA334815-6D78-4E9A-9F4D-6C8A58222A57}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FA334815-6D78-4E9A-9F4D-6C8A58222A57}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
107
DarkUI/Config/Colors.cs
Normal file
107
DarkUI/Config/Colors.cs
Normal file
@ -0,0 +1,107 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace DarkUI
|
||||
{
|
||||
public sealed class Colors
|
||||
{
|
||||
public static Color GreyBackground
|
||||
{
|
||||
get { return Color.FromArgb(60, 63, 65); }
|
||||
}
|
||||
|
||||
public static Color HeaderBackground
|
||||
{
|
||||
get { return Color.FromArgb(57, 60, 62); }
|
||||
}
|
||||
|
||||
public static Color BlueBackground
|
||||
{
|
||||
get { return Color.FromArgb(66, 77, 95); }
|
||||
}
|
||||
|
||||
public static Color DarkBlueBackground
|
||||
{
|
||||
get { return Color.FromArgb(52, 57, 66); }
|
||||
}
|
||||
|
||||
public static Color DarkBackground
|
||||
{
|
||||
get { return Color.FromArgb(43, 43, 43); }
|
||||
}
|
||||
|
||||
public static Color MediumBackground
|
||||
{
|
||||
get { return Color.FromArgb(49, 51, 53); }
|
||||
}
|
||||
|
||||
public static Color LightBackground
|
||||
{
|
||||
get { return Color.FromArgb(69, 73, 74); }
|
||||
}
|
||||
|
||||
public static Color LighterBackground
|
||||
{
|
||||
get { return Color.FromArgb(95, 101, 102); }
|
||||
}
|
||||
|
||||
public static Color LightBorder
|
||||
{
|
||||
get { return Color.FromArgb(81, 81, 81); }
|
||||
}
|
||||
|
||||
public static Color DarkBorder
|
||||
{
|
||||
get { return Color.FromArgb(51, 51, 51); }
|
||||
}
|
||||
|
||||
public static Color LightText
|
||||
{
|
||||
get { return Color.FromArgb(220, 220, 220); }
|
||||
}
|
||||
|
||||
public static Color DisabledText
|
||||
{
|
||||
get { return Color.FromArgb(153, 153, 153); }
|
||||
}
|
||||
|
||||
public static Color BlueHighlight
|
||||
{
|
||||
get { return Color.FromArgb(104, 151, 187); }
|
||||
}
|
||||
|
||||
public static Color BlueSelection
|
||||
{
|
||||
get { return Color.FromArgb(75, 110, 175); }
|
||||
}
|
||||
|
||||
public static Color GreyHighlight
|
||||
{
|
||||
get { return Color.FromArgb(122, 128, 132); }
|
||||
}
|
||||
|
||||
public static Color GreySelection
|
||||
{
|
||||
get { return Color.FromArgb(92, 92, 92); }
|
||||
}
|
||||
|
||||
public static Color DarkGreySelection
|
||||
{
|
||||
get { return Color.FromArgb(82, 82, 82); }
|
||||
}
|
||||
|
||||
public static Color DarkBlueBorder
|
||||
{
|
||||
get { return Color.FromArgb(51, 61, 78); }
|
||||
}
|
||||
|
||||
public static Color LightBlueBorder
|
||||
{
|
||||
get { return Color.FromArgb(86, 97, 114); }
|
||||
}
|
||||
|
||||
public static Color ActiveControl
|
||||
{
|
||||
get { return Color.FromArgb(159, 178, 196); }
|
||||
}
|
||||
}
|
||||
}
|
7
DarkUI/Config/Consts.cs
Normal file
7
DarkUI/Config/Consts.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace DarkUI
|
||||
{
|
||||
public sealed class Consts
|
||||
{
|
||||
public static int Padding = 10;
|
||||
}
|
||||
}
|
22
DarkUI/Config/Enums.cs
Normal file
22
DarkUI/Config/Enums.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace DarkUI
|
||||
{
|
||||
public enum DarkButtonStyle
|
||||
{
|
||||
Normal,
|
||||
Flat
|
||||
}
|
||||
|
||||
public enum DarkControlState
|
||||
{
|
||||
Normal,
|
||||
Hover,
|
||||
Pressed
|
||||
}
|
||||
|
||||
public enum DarkContentAlignment
|
||||
{
|
||||
Center,
|
||||
Left,
|
||||
Right
|
||||
}
|
||||
}
|
423
DarkUI/Controls/DarkButton.cs
Normal file
423
DarkUI/Controls/DarkButton.cs
Normal file
@ -0,0 +1,423 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DarkUI
|
||||
{
|
||||
[ToolboxBitmap(typeof(Button))]
|
||||
[DefaultEvent("Click")]
|
||||
public class DarkButton : Button
|
||||
{
|
||||
#region Field Region
|
||||
|
||||
private DarkButtonStyle _style = DarkButtonStyle.Normal;
|
||||
private DarkControlState _buttonState = DarkControlState.Normal;
|
||||
|
||||
private bool _isDefault;
|
||||
private bool _spacePressed;
|
||||
|
||||
private int _padding = Consts.Padding / 2;
|
||||
private int _imagePadding = 5; // Consts.Padding / 2
|
||||
|
||||
#endregion
|
||||
|
||||
#region Designer Property Region
|
||||
|
||||
[Category("Appearance")]
|
||||
[Description("The text associated with this control.")]
|
||||
public new string Text
|
||||
{
|
||||
get { return base.Text; }
|
||||
set
|
||||
{
|
||||
base.Text = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Behavior")]
|
||||
[Description("Indicates whether the control is enabled.")]
|
||||
public new bool Enabled
|
||||
{
|
||||
get { return base.Enabled; }
|
||||
set
|
||||
{
|
||||
base.Enabled = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Appearance")]
|
||||
[Description("Determines the style of the button.")]
|
||||
[DefaultValue(DarkButtonStyle.Normal)]
|
||||
public DarkButtonStyle ButtonStyle
|
||||
{
|
||||
get { return _style; }
|
||||
set
|
||||
{
|
||||
_style = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Appearance")]
|
||||
[Description("Determines the amount of padding between the image and text.")]
|
||||
[DefaultValue(5)]
|
||||
public int ImagePadding
|
||||
{
|
||||
get { return _imagePadding; }
|
||||
set
|
||||
{
|
||||
_imagePadding = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Code Property Region
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public DarkControlState ButtonState
|
||||
{
|
||||
get { return _buttonState; }
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new ContentAlignment TextAlign
|
||||
{
|
||||
get { return base.TextAlign; }
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new ContentAlignment ImageAlign
|
||||
{
|
||||
get { return base.ImageAlign; }
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new bool AutoEllipsis
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new bool FlatAppearance
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new FlatStyle FlatStyle
|
||||
{
|
||||
get { return base.FlatStyle; }
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new bool UseCompatibleTextRendering
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new bool UseVisualStyleBackColor
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor Region
|
||||
|
||||
public DarkButton()
|
||||
{
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer |
|
||||
ControlStyles.ResizeRedraw |
|
||||
ControlStyles.UserPaint, true);
|
||||
|
||||
base.UseVisualStyleBackColor = false;
|
||||
base.UseCompatibleTextRendering = false;
|
||||
|
||||
SetButtonState(DarkControlState.Normal);
|
||||
Padding = new Padding(_padding);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method Region
|
||||
|
||||
private void SetButtonState(DarkControlState buttonState)
|
||||
{
|
||||
if (_buttonState != buttonState)
|
||||
{
|
||||
_buttonState = buttonState;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handler Region
|
||||
|
||||
protected override void OnCreateControl()
|
||||
{
|
||||
base.OnCreateControl();
|
||||
|
||||
var form = FindForm();
|
||||
if (form != null)
|
||||
{
|
||||
if (form.AcceptButton == this)
|
||||
_isDefault = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseMove(e);
|
||||
|
||||
if (_spacePressed)
|
||||
return;
|
||||
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
if (ClientRectangle.Contains(e.Location))
|
||||
SetButtonState(DarkControlState.Pressed);
|
||||
else
|
||||
SetButtonState(DarkControlState.Hover);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetButtonState(DarkControlState.Hover);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseDown(e);
|
||||
|
||||
if (!ClientRectangle.Contains(e.Location))
|
||||
return;
|
||||
|
||||
SetButtonState(DarkControlState.Pressed);
|
||||
}
|
||||
|
||||
protected override void OnMouseUp(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseUp(e);
|
||||
|
||||
if (_spacePressed)
|
||||
return;
|
||||
|
||||
SetButtonState(DarkControlState.Normal);
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(EventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
|
||||
if (_spacePressed)
|
||||
return;
|
||||
|
||||
SetButtonState(DarkControlState.Normal);
|
||||
}
|
||||
|
||||
protected override void OnMouseCaptureChanged(EventArgs e)
|
||||
{
|
||||
base.OnMouseCaptureChanged(e);
|
||||
|
||||
if (_spacePressed)
|
||||
return;
|
||||
|
||||
var location = Cursor.Position;
|
||||
|
||||
if (!ClientRectangle.Contains(location))
|
||||
SetButtonState(DarkControlState.Normal);
|
||||
}
|
||||
|
||||
protected override void OnGotFocus(EventArgs e)
|
||||
{
|
||||
base.OnGotFocus(e);
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnLostFocus(EventArgs e)
|
||||
{
|
||||
base.OnLostFocus(e);
|
||||
|
||||
_spacePressed = false;
|
||||
|
||||
var location = Cursor.Position;
|
||||
|
||||
if (!ClientRectangle.Contains(location))
|
||||
SetButtonState(DarkControlState.Normal);
|
||||
else
|
||||
SetButtonState(DarkControlState.Hover);
|
||||
}
|
||||
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
|
||||
if (e.KeyCode == Keys.Space)
|
||||
{
|
||||
_spacePressed = true;
|
||||
SetButtonState(DarkControlState.Pressed);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnKeyUp(KeyEventArgs e)
|
||||
{
|
||||
base.OnKeyUp(e);
|
||||
|
||||
if (e.KeyCode == Keys.Space)
|
||||
{
|
||||
_spacePressed = false;
|
||||
|
||||
var location = Cursor.Position;
|
||||
|
||||
if (!ClientRectangle.Contains(location))
|
||||
SetButtonState(DarkControlState.Normal);
|
||||
else
|
||||
SetButtonState(DarkControlState.Hover);
|
||||
}
|
||||
}
|
||||
|
||||
public override void NotifyDefault(bool value)
|
||||
{
|
||||
base.NotifyDefault(value);
|
||||
|
||||
if (!DesignMode)
|
||||
return;
|
||||
|
||||
_isDefault = value;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Paint Region
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
var g = e.Graphics;
|
||||
var rect = new Rectangle(0, 0, ClientSize.Width, ClientSize.Height);
|
||||
|
||||
var textColor = Colors.LightText;
|
||||
var borderColor = Colors.GreySelection;
|
||||
var fillColor = _isDefault ? Colors.DarkBlueBackground : Colors.LightBackground;
|
||||
|
||||
if (Enabled)
|
||||
{
|
||||
if (ButtonStyle == DarkButtonStyle.Normal)
|
||||
{
|
||||
if (Focused && TabStop)
|
||||
borderColor = Colors.BlueHighlight;
|
||||
|
||||
switch (ButtonState)
|
||||
{
|
||||
case DarkControlState.Hover:
|
||||
fillColor = _isDefault ? Colors.BlueBackground : Colors.LighterBackground;
|
||||
break;
|
||||
case DarkControlState.Pressed:
|
||||
fillColor = _isDefault ? Colors.DarkBackground : Colors.DarkBackground;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (ButtonStyle == DarkButtonStyle.Flat)
|
||||
{
|
||||
switch (ButtonState)
|
||||
{
|
||||
case DarkControlState.Normal:
|
||||
fillColor = Colors.GreyBackground;
|
||||
break;
|
||||
case DarkControlState.Hover:
|
||||
fillColor = Colors.MediumBackground;
|
||||
break;
|
||||
case DarkControlState.Pressed:
|
||||
fillColor = Colors.DarkBackground;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
textColor = Colors.DisabledText;
|
||||
fillColor = Colors.DarkGreySelection;
|
||||
}
|
||||
|
||||
using (var b = new SolidBrush(fillColor))
|
||||
{
|
||||
g.FillRectangle(b, rect);
|
||||
}
|
||||
|
||||
if (ButtonStyle == DarkButtonStyle.Normal)
|
||||
{
|
||||
using (var p = new Pen(borderColor, 1))
|
||||
{
|
||||
var modRect = new Rectangle(rect.Left, rect.Top, rect.Width - 1, rect.Height - 1);
|
||||
|
||||
g.DrawRectangle(p, modRect);
|
||||
}
|
||||
}
|
||||
|
||||
var textOffsetX = 0;
|
||||
var textOffsetY = 0;
|
||||
|
||||
if (Image != null)
|
||||
{
|
||||
var stringSize = g.MeasureString(Text, Font, rect.Size);
|
||||
|
||||
var x = 0;
|
||||
var y = (ClientSize.Height / 2) - (Image.Size.Height / 2);
|
||||
|
||||
switch (TextImageRelation)
|
||||
{
|
||||
case TextImageRelation.ImageAboveText:
|
||||
textOffsetY = (Image.Size.Height / 2) + (ImagePadding / 2);
|
||||
y = y - ((int)(stringSize.Height / 2) + (ImagePadding / 2));
|
||||
break;
|
||||
case TextImageRelation.TextAboveImage:
|
||||
textOffsetY = ((Image.Size.Height / 2) + (ImagePadding / 2)) * -1;
|
||||
y = y + ((int)(stringSize.Height / 2) + (ImagePadding / 2));
|
||||
break;
|
||||
case TextImageRelation.ImageBeforeText:
|
||||
textOffsetX = Image.Size.Width + ImagePadding;
|
||||
break;
|
||||
case TextImageRelation.TextBeforeImage:
|
||||
x = x + (int)stringSize.Width;
|
||||
break;
|
||||
}
|
||||
|
||||
g.DrawImageUnscaled(Image, x, y);
|
||||
}
|
||||
|
||||
using (var b = new SolidBrush(textColor))
|
||||
{
|
||||
var modRect = new Rectangle(rect.Left + textOffsetX + Padding.Left,
|
||||
rect.Top + textOffsetY + Padding.Top, rect.Width - Padding.Horizontal,
|
||||
rect.Height - Padding.Vertical);
|
||||
|
||||
var stringFormat = new StringFormat
|
||||
{
|
||||
LineAlignment = StringAlignment.Center,
|
||||
Alignment = StringAlignment.Center,
|
||||
Trimming = StringTrimming.EllipsisCharacter
|
||||
};
|
||||
|
||||
g.DrawString(Text, Font, b, modRect, stringFormat);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
56
DarkUI/DarkUI.csproj
Normal file
56
DarkUI/DarkUI.csproj
Normal file
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F19472F5-8C44-4C51-A8A0-B9DE5F555255}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DarkUI</RootNamespace>
|
||||
<AssemblyName>DarkUI</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Config\Colors.cs" />
|
||||
<Compile Include="Config\Consts.cs" />
|
||||
<Compile Include="Config\Enums.cs" />
|
||||
<Compile Include="Controls\DarkButton.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
36
DarkUI/Properties/AssemblyInfo.cs
Normal file
36
DarkUI/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Dark UI")]
|
||||
[assembly: AssemblyDescription("Dark themed control and docking library for .NET WinForms.")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Robin Perris")]
|
||||
[assembly: AssemblyProduct("Dark UI")]
|
||||
[assembly: AssemblyCopyright("Copyright © Robin Perris")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("f19472f5-8c44-4c51-a8a0-b9de5f555255")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
87
Example/Example.csproj
Normal file
87
Example/Example.csproj
Normal file
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{FA334815-6D78-4E9A-9F4D-6C8A58222A57}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Example</RootNamespace>
|
||||
<AssemblyName>Example</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Forms\MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Forms\MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DarkUI\DarkUI.csproj">
|
||||
<Project>{f19472f5-8c44-4c51-a8a0-b9de5f555255}</Project>
|
||||
<Name>DarkUI</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
91
Example/Forms/MainForm.Designer.cs
generated
Normal file
91
Example/Forms/MainForm.Designer.cs
generated
Normal file
@ -0,0 +1,91 @@
|
||||
namespace Example
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btnConfirm = new DarkUI.DarkButton();
|
||||
this.btnCancel = new DarkUI.DarkButton();
|
||||
this.btnDisabled = new DarkUI.DarkButton();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnConfirm
|
||||
//
|
||||
this.btnConfirm.Location = new System.Drawing.Point(12, 12);
|
||||
this.btnConfirm.Name = "btnConfirm";
|
||||
this.btnConfirm.Padding = new System.Windows.Forms.Padding(5);
|
||||
this.btnConfirm.Size = new System.Drawing.Size(95, 27);
|
||||
this.btnConfirm.TabIndex = 0;
|
||||
this.btnConfirm.Text = "Confirm";
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(113, 12);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Padding = new System.Windows.Forms.Padding(5);
|
||||
this.btnCancel.Size = new System.Drawing.Size(95, 27);
|
||||
this.btnCancel.TabIndex = 1;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
//
|
||||
// btnDisabled
|
||||
//
|
||||
this.btnDisabled.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnDisabled.Enabled = false;
|
||||
this.btnDisabled.Location = new System.Drawing.Point(214, 12);
|
||||
this.btnDisabled.Name = "btnDisabled";
|
||||
this.btnDisabled.Padding = new System.Windows.Forms.Padding(5);
|
||||
this.btnDisabled.Size = new System.Drawing.Size(95, 27);
|
||||
this.btnDisabled.TabIndex = 2;
|
||||
this.btnDisabled.Text = "Disabled";
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AcceptButton = this.btnConfirm;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(331, 302);
|
||||
this.Controls.Add(this.btnDisabled);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnConfirm);
|
||||
this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Name = "MainForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Dark UI - Example";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DarkUI.DarkButton btnConfirm;
|
||||
private DarkUI.DarkButton btnCancel;
|
||||
private DarkUI.DarkButton btnDisabled;
|
||||
}
|
||||
}
|
||||
|
12
Example/Forms/MainForm.cs
Normal file
12
Example/Forms/MainForm.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
120
Example/Forms/MainForm.resx
Normal file
120
Example/Forms/MainForm.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
19
Example/Program.cs
Normal file
19
Example/Program.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
}
|
||||
}
|
36
Example/Properties/AssemblyInfo.cs
Normal file
36
Example/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Dark UI Example")]
|
||||
[assembly: AssemblyDescription("Examlpe application for Dark UI")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Robin Perris")]
|
||||
[assembly: AssemblyProduct("Dark UI")]
|
||||
[assembly: AssemblyCopyright("Copyright © Robin Perris")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("fa334815-6d78-4e9a-9f4d-6c8a58222a57")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
63
Example/Properties/Resources.Designer.cs
generated
Normal file
63
Example/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Example.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Example.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
Example/Properties/Resources.resx
Normal file
117
Example/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
26
Example/Properties/Settings.Designer.cs
generated
Normal file
26
Example/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Example.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
Example/Properties/Settings.settings
Normal file
7
Example/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
Loading…
Reference in New Issue
Block a user