Compare commits
25 Commits
main
...
Create_lib
Author | SHA1 | Date | |
---|---|---|---|
|
7cb9784d4f | ||
|
0479020de6 | ||
|
b84f61e1cb | ||
|
8771c2c962 | ||
|
78810b76e6 | ||
|
32b483ff02 | ||
|
6e40e75b38 | ||
|
3733e7b099 | ||
|
df6dc6cc54 | ||
|
9ca65527e1 | ||
|
5ee58b256e | ||
|
1ff7c269ba | ||
|
edb62e34b6 | ||
|
479b08bcf0 | ||
|
1944070931 | ||
|
74aa787f1d | ||
|
bf736e563d | ||
|
8666b365b0 | ||
|
cbabf209bb | ||
|
1605f4c548 | ||
|
bb487bf6e1 | ||
|
51152f5d9b | ||
|
1be19b8943 | ||
|
fa7bb6f3c8 | ||
|
a70cfd1d18 |
@ -1,25 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.6.33815.320
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualComponents", "VisualComponents\VisualComponents.csproj", "{E5333284-B1A3-4A29-AFFB-5DB3692C036B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E5333284-B1A3-4A29-AFFB-5DB3692C036B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E5333284-B1A3-4A29-AFFB-5DB3692C036B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E5333284-B1A3-4A29-AFFB-5DB3692C036B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E5333284-B1A3-4A29-AFFB-5DB3692C036B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {0C8F62C5-A49D-4EEF-8AA8-3F9E0682A2E3}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
39
VisualComponents/VisualComponents/Form1.Designer.cs
generated
39
VisualComponents/VisualComponents/Form1.Designer.cs
generated
@ -1,39 +0,0 @@
|
||||
namespace VisualComponents
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "Form1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
namespace VisualComponents
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
31
VisualComponentsForm/VisualComponentsForm.sln
Normal file
31
VisualComponentsForm/VisualComponentsForm.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.6.33815.320
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualComponentsForm", "VisualComponentsForm\VisualComponentsForm.csproj", "{29E20B1C-11E3-4B0D-A614-097ACBB21263}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualComponentsLib", "..\VisualComponentsLib\VisualComponentsLib.csproj", "{F5B8AE30-4836-44F8-AC47-75D2B05D73EF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{29E20B1C-11E3-4B0D-A614-097ACBB21263}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{29E20B1C-11E3-4B0D-A614-097ACBB21263}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{29E20B1C-11E3-4B0D-A614-097ACBB21263}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{29E20B1C-11E3-4B0D-A614-097ACBB21263}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F5B8AE30-4836-44F8-AC47-75D2B05D73EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F5B8AE30-4836-44F8-AC47-75D2B05D73EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F5B8AE30-4836-44F8-AC47-75D2B05D73EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F5B8AE30-4836-44F8-AC47-75D2B05D73EF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {ADD13092-BD8B-4F13-97C5-0C56B2AB3309}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
249
VisualComponentsForm/VisualComponentsForm/FormMain.Designer.cs
generated
Normal file
249
VisualComponentsForm/VisualComponentsForm/FormMain.Designer.cs
generated
Normal file
@ -0,0 +1,249 @@
|
||||
namespace VisualComponentsForm
|
||||
{
|
||||
partial class FormMain
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
labelCheck = new Label();
|
||||
buttonCheck = new Button();
|
||||
myListBox = new VisualComponentsLib.CustomListBox.MyListBox();
|
||||
textBoxInput = new TextBox();
|
||||
buttonAddList = new Button();
|
||||
buttonClear = new Button();
|
||||
groupBox = new GroupBox();
|
||||
groupBox1 = new GroupBox();
|
||||
myTextBox = new VisualComponentsLib.MyTextBox();
|
||||
labelCheckTwo = new Label();
|
||||
buttonCheckTwo = new Button();
|
||||
myDataGridView = new VisualComponentsLib.MyDataGridView();
|
||||
buttonCreateColumns = new Button();
|
||||
buttonClearTable = new Button();
|
||||
groupBox2 = new GroupBox();
|
||||
buttonAddObject = new Button();
|
||||
groupBox.SuspendLayout();
|
||||
groupBox1.SuspendLayout();
|
||||
groupBox2.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// labelCheck
|
||||
//
|
||||
labelCheck.AutoSize = true;
|
||||
labelCheck.BorderStyle = BorderStyle.FixedSingle;
|
||||
labelCheck.Location = new Point(292, 134);
|
||||
labelCheck.Name = "labelCheck";
|
||||
labelCheck.Size = new Size(62, 17);
|
||||
labelCheck.TabIndex = 1;
|
||||
labelCheck.Text = "Значение";
|
||||
//
|
||||
// buttonCheck
|
||||
//
|
||||
buttonCheck.Location = new Point(279, 166);
|
||||
buttonCheck.Name = "buttonCheck";
|
||||
buttonCheck.Size = new Size(75, 23);
|
||||
buttonCheck.TabIndex = 2;
|
||||
buttonCheck.Text = "Проверка";
|
||||
buttonCheck.UseVisualStyleBackColor = true;
|
||||
buttonCheck.Click += ButtonCheck_Click;
|
||||
//
|
||||
// myListBox
|
||||
//
|
||||
myListBox.Location = new Point(6, 22);
|
||||
myListBox.MinimumSize = new Size(84, 53);
|
||||
myListBox.Name = "myListBox";
|
||||
myListBox.SelectedString = null;
|
||||
myListBox.Size = new Size(242, 240);
|
||||
myListBox.TabIndex = 3;
|
||||
//
|
||||
// textBoxInput
|
||||
//
|
||||
textBoxInput.Location = new Point(254, 25);
|
||||
textBoxInput.Name = "textBoxInput";
|
||||
textBoxInput.Size = new Size(100, 23);
|
||||
textBoxInput.TabIndex = 4;
|
||||
//
|
||||
// buttonAddList
|
||||
//
|
||||
buttonAddList.Location = new Point(279, 54);
|
||||
buttonAddList.Name = "buttonAddList";
|
||||
buttonAddList.Size = new Size(75, 23);
|
||||
buttonAddList.TabIndex = 5;
|
||||
buttonAddList.Text = "Добавить";
|
||||
buttonAddList.UseVisualStyleBackColor = true;
|
||||
buttonAddList.Click += ButtonAddList_Click;
|
||||
//
|
||||
// buttonClear
|
||||
//
|
||||
buttonClear.Location = new Point(279, 83);
|
||||
buttonClear.Name = "buttonClear";
|
||||
buttonClear.Size = new Size(75, 23);
|
||||
buttonClear.TabIndex = 6;
|
||||
buttonClear.Text = "Очистить";
|
||||
buttonClear.UseVisualStyleBackColor = true;
|
||||
buttonClear.Click += ButtonClear_Click;
|
||||
//
|
||||
// groupBox
|
||||
//
|
||||
groupBox.Controls.Add(myListBox);
|
||||
groupBox.Controls.Add(buttonClear);
|
||||
groupBox.Controls.Add(labelCheck);
|
||||
groupBox.Controls.Add(buttonAddList);
|
||||
groupBox.Controls.Add(buttonCheck);
|
||||
groupBox.Controls.Add(textBoxInput);
|
||||
groupBox.Location = new Point(12, 12);
|
||||
groupBox.Name = "groupBox";
|
||||
groupBox.Size = new Size(368, 271);
|
||||
groupBox.TabIndex = 7;
|
||||
groupBox.TabStop = false;
|
||||
groupBox.Text = "Первый компонент";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
groupBox1.Controls.Add(myTextBox);
|
||||
groupBox1.Controls.Add(labelCheckTwo);
|
||||
groupBox1.Controls.Add(buttonCheckTwo);
|
||||
groupBox1.Location = new Point(12, 296);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new Size(368, 106);
|
||||
groupBox1.TabIndex = 8;
|
||||
groupBox1.TabStop = false;
|
||||
groupBox1.Text = "Второй компонент";
|
||||
//
|
||||
// myTextBox
|
||||
//
|
||||
myTextBox.Location = new Point(6, 20);
|
||||
myTextBox.Name = "myTextBox";
|
||||
myTextBox.Size = new Size(210, 80);
|
||||
myTextBox.TabIndex = 5;
|
||||
//
|
||||
// labelCheckTwo
|
||||
//
|
||||
labelCheckTwo.AutoSize = true;
|
||||
labelCheckTwo.BorderStyle = BorderStyle.FixedSingle;
|
||||
labelCheckTwo.Location = new Point(279, 30);
|
||||
labelCheckTwo.Name = "labelCheckTwo";
|
||||
labelCheckTwo.Size = new Size(62, 17);
|
||||
labelCheckTwo.TabIndex = 3;
|
||||
labelCheckTwo.Text = "Значение";
|
||||
//
|
||||
// buttonCheckTwo
|
||||
//
|
||||
buttonCheckTwo.Location = new Point(266, 66);
|
||||
buttonCheckTwo.Name = "buttonCheckTwo";
|
||||
buttonCheckTwo.Size = new Size(75, 23);
|
||||
buttonCheckTwo.TabIndex = 4;
|
||||
buttonCheckTwo.Text = "Проверка";
|
||||
buttonCheckTwo.UseVisualStyleBackColor = true;
|
||||
buttonCheckTwo.Click += ButtonCheckTwo_Click;
|
||||
//
|
||||
// myDataGridView
|
||||
//
|
||||
myDataGridView.IndexRow = -1;
|
||||
myDataGridView.Location = new Point(6, 22);
|
||||
myDataGridView.Name = "myDataGridView";
|
||||
myDataGridView.Size = new Size(649, 234);
|
||||
myDataGridView.TabIndex = 0;
|
||||
//
|
||||
// buttonCreateColumns
|
||||
//
|
||||
buttonCreateColumns.Location = new Point(76, 278);
|
||||
buttonCreateColumns.Name = "buttonCreateColumns";
|
||||
buttonCreateColumns.Size = new Size(75, 23);
|
||||
buttonCreateColumns.TabIndex = 3;
|
||||
buttonCreateColumns.Text = "Создать";
|
||||
buttonCreateColumns.UseVisualStyleBackColor = true;
|
||||
buttonCreateColumns.Click += ButtonCreateColumns_Click;
|
||||
//
|
||||
// buttonClearTable
|
||||
//
|
||||
buttonClearTable.Location = new Point(557, 278);
|
||||
buttonClearTable.Name = "buttonClearTable";
|
||||
buttonClearTable.Size = new Size(75, 23);
|
||||
buttonClearTable.TabIndex = 4;
|
||||
buttonClearTable.Text = "Очистить";
|
||||
buttonClearTable.UseVisualStyleBackColor = true;
|
||||
buttonClearTable.Click += ButtonClearTable_Click;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
groupBox2.Controls.Add(buttonAddObject);
|
||||
groupBox2.Controls.Add(buttonClearTable);
|
||||
groupBox2.Controls.Add(buttonCreateColumns);
|
||||
groupBox2.Controls.Add(myDataGridView);
|
||||
groupBox2.Location = new Point(386, 18);
|
||||
groupBox2.Name = "groupBox2";
|
||||
groupBox2.Size = new Size(661, 313);
|
||||
groupBox2.TabIndex = 9;
|
||||
groupBox2.TabStop = false;
|
||||
groupBox2.Text = "Третий компонент";
|
||||
//
|
||||
// buttonAddObject
|
||||
//
|
||||
buttonAddObject.Location = new Point(172, 278);
|
||||
buttonAddObject.Name = "buttonAddObject";
|
||||
buttonAddObject.Size = new Size(127, 23);
|
||||
buttonAddObject.TabIndex = 5;
|
||||
buttonAddObject.Text = "Добавить объект";
|
||||
buttonAddObject.UseVisualStyleBackColor = true;
|
||||
buttonAddObject.Click += ButtonAddObject_Click;
|
||||
//
|
||||
// FormMain
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1059, 412);
|
||||
Controls.Add(groupBox2);
|
||||
Controls.Add(groupBox1);
|
||||
Controls.Add(groupBox);
|
||||
Name = "FormMain";
|
||||
Text = "Тестовое окно";
|
||||
groupBox.ResumeLayout(false);
|
||||
groupBox.PerformLayout();
|
||||
groupBox1.ResumeLayout(false);
|
||||
groupBox1.PerformLayout();
|
||||
groupBox2.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
private Label labelCheck;
|
||||
private Button buttonCheck;
|
||||
private VisualComponentsLib.CustomListBox.MyListBox myListBox;
|
||||
private TextBox textBoxInput;
|
||||
private Button buttonAddList;
|
||||
private Button buttonClear;
|
||||
private GroupBox groupBox;
|
||||
private GroupBox groupBox1;
|
||||
private Label labelCheckTwo;
|
||||
private Button buttonCheckTwo;
|
||||
private VisualComponentsLib.MyTextBox myTextBox;
|
||||
private VisualComponentsLib.MyDataGridView myDataGridView;
|
||||
private Button buttonCreateColumns;
|
||||
private Button buttonClearTable;
|
||||
private GroupBox groupBox2;
|
||||
private Button buttonAddObject;
|
||||
}
|
||||
}
|
87
VisualComponentsForm/VisualComponentsForm/FormMain.cs
Normal file
87
VisualComponentsForm/VisualComponentsForm/FormMain.cs
Normal file
@ -0,0 +1,87 @@
|
||||
using VisualComponentsForm.Models;
|
||||
|
||||
namespace VisualComponentsForm
|
||||
{
|
||||
public partial class FormMain : Form
|
||||
{
|
||||
private int countCol = 4;
|
||||
private int numberObject;
|
||||
|
||||
private List<string> nameCol = new List<string> { "Íîìåð", "Èìÿ", "Ôàìèëèÿ", "Âîçðàñò" };
|
||||
private List<int> widthCol = new List<int> { 60, 60, 60, 60 };
|
||||
private List<bool> showCol = new List<bool> { true, true, true, true };
|
||||
private List<string> nameField = new List<string> { "Id", "Name", "Surname", "Age" };
|
||||
private List<People> peoples;
|
||||
|
||||
public FormMain()
|
||||
{
|
||||
numberObject = 0;
|
||||
|
||||
peoples = new List<People>
|
||||
{
|
||||
new People(0, "Íèêèòà", "Ñåðãååâ", 20),
|
||||
new People(1, "Äàðüÿ", "Áàëáåðîâà", 19),
|
||||
new People(2, "Äàíèë", "Ìàëèí", 25),
|
||||
new People(3, "Íèêîëàé", "Ðàñïàåâ", 23)
|
||||
};
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ButtonCheck_Click(object sender, EventArgs e)
|
||||
{
|
||||
labelCheck.Text = myListBox.SelectedString;
|
||||
}
|
||||
|
||||
private void ButtonAddList_Click(object sender, EventArgs e)
|
||||
{
|
||||
myListBox.AddItem(textBoxInput.Text);
|
||||
|
||||
textBoxInput.Text = string.Empty;
|
||||
}
|
||||
|
||||
private void ButtonClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
myListBox.ClearAll();
|
||||
}
|
||||
|
||||
//òåñò âòîðîãî êîìïîíåíòà
|
||||
|
||||
private void ButtonCheckTwo_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
labelCheckTwo.Text = myTextBox.TextBoxValue.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
//òåñò òðåòüåãî êîìïîíåíòà
|
||||
|
||||
private void ButtonCreateColumns_Click(object sender, EventArgs e)
|
||||
{
|
||||
myDataGridView.AddHeader(countCol, nameCol, widthCol, showCol, nameField);
|
||||
}
|
||||
|
||||
private void ButtonClearTable_Click(object sender, EventArgs e)
|
||||
{
|
||||
myDataGridView.ClearTable();
|
||||
}
|
||||
|
||||
private void ButtonAddObject_Click(object sender, EventArgs e)
|
||||
{
|
||||
myDataGridView.AddObject(peoples[numberObject]);
|
||||
|
||||
numberObject++;
|
||||
|
||||
if (numberObject == 4)
|
||||
{
|
||||
numberObject = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
120
VisualComponentsForm/VisualComponentsForm/FormMain.resx
Normal file
120
VisualComponentsForm/VisualComponentsForm/FormMain.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
29
VisualComponentsForm/VisualComponentsForm/Models/People.cs
Normal file
29
VisualComponentsForm/VisualComponentsForm/Models/People.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VisualComponentsForm.Models
|
||||
{
|
||||
public class People
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
|
||||
public string? Surname { get; set; }
|
||||
|
||||
public int? Age { get; set; }
|
||||
|
||||
public People() { }
|
||||
|
||||
public People(int Id, string Name, string Surname, int Age)
|
||||
{
|
||||
this.Id = Id;
|
||||
this.Name = Name;
|
||||
this.Surname = Surname;
|
||||
this.Age = Age;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace VisualComponents
|
||||
namespace VisualComponentsForm
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
@ -11,7 +11,7 @@ namespace VisualComponents
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new Form1());
|
||||
Application.Run(new FormMain());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\VisualComponentsLib\VisualComponentsLib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
19
VisualComponentsLib/CustomException/TextBoxException.cs
Normal file
19
VisualComponentsLib/CustomException/TextBoxException.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace VisualComponentsLib.CustomException
|
||||
{
|
||||
[Serializable]
|
||||
public class TextBoxException : Exception
|
||||
{
|
||||
// Constructors
|
||||
public TextBoxException(string message)
|
||||
: base(message)
|
||||
{ }
|
||||
|
||||
// Ensure Exception is Serializable
|
||||
protected TextBoxException(SerializationInfo info, StreamingContext ctxt)
|
||||
: base(info, ctxt)
|
||||
{ }
|
||||
}
|
||||
}
|
61
VisualComponentsLib/MyDataGridView.Designer.cs
generated
Normal file
61
VisualComponentsLib/MyDataGridView.Designer.cs
generated
Normal file
@ -0,0 +1,61 @@
|
||||
namespace VisualComponentsLib
|
||||
{
|
||||
partial class MyDataGridView
|
||||
{
|
||||
/// <summary>
|
||||
/// Обязательная переменная конструктора.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Освободить все используемые ресурсы.
|
||||
/// </summary>
|
||||
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Код, автоматически созданный конструктором компонентов
|
||||
|
||||
/// <summary>
|
||||
/// Требуемый метод для поддержки конструктора — не изменяйте
|
||||
/// содержимое этого метода с помощью редактора кода.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
dataGridView = new DataGridView();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Location = new Point(3, 3);
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.RowTemplate.Height = 25;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(290, 177);
|
||||
dataGridView.TabIndex = 0;
|
||||
//
|
||||
// MyDataGridView
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Controls.Add(dataGridView);
|
||||
Name = "MyDataGridView";
|
||||
Size = new Size(296, 183);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DataGridView dataGridView;
|
||||
}
|
||||
}
|
114
VisualComponentsLib/MyDataGridView.cs
Normal file
114
VisualComponentsLib/MyDataGridView.cs
Normal file
@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace VisualComponentsLib
|
||||
{
|
||||
public partial class MyDataGridView : UserControl
|
||||
{
|
||||
//метод для получения индекса выбранной строки
|
||||
public int IndexRow
|
||||
{
|
||||
get
|
||||
{
|
||||
if (dataGridView.CurrentCell == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return dataGridView.CurrentCell.RowIndex;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (dataGridView.CurrentCell != null)
|
||||
{
|
||||
dataGridView.CurrentCell = dataGridView.Rows[value].Cells[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MyDataGridView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
//публичный метод создания заголовков таблицы
|
||||
public void AddHeader(int countCol, List<string> nameCol, List<int> widthCol,
|
||||
List<bool> showCol, List<string> nameField)
|
||||
{
|
||||
for (int i = 0; i < countCol; i++)
|
||||
{
|
||||
DataGridViewColumn textColumn = new DataGridViewColumn();
|
||||
|
||||
textColumn.Name = nameField[i];
|
||||
textColumn.HeaderText = nameCol[i];
|
||||
textColumn.Width = widthCol[i];
|
||||
textColumn.Visible = showCol[i];
|
||||
textColumn.CellTemplate = new DataGridViewTextBoxCell();
|
||||
|
||||
dataGridView.Columns.Add(textColumn);
|
||||
}
|
||||
}
|
||||
|
||||
//публичный параметризованный метод для добавления нового объекта в список
|
||||
public void AddObject<T>(T newObject)
|
||||
{
|
||||
DataGridViewRow row = (DataGridViewRow)dataGridView.Rows[0].Clone();
|
||||
|
||||
foreach (var prop in newObject.GetType().GetProperties())
|
||||
{
|
||||
object value = prop.GetValue(newObject);
|
||||
|
||||
row.Cells[dataGridView.Columns[prop.Name].Index].Value = value;
|
||||
}
|
||||
|
||||
dataGridView.Rows.Add(row);
|
||||
}
|
||||
|
||||
//публичный параметризованный метод для получения нового объекта из списка
|
||||
public T GetSelectedObject<T>() where T : new()
|
||||
{
|
||||
if (dataGridView.SelectedCells.Count == 0)
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
|
||||
int rowIndex = dataGridView.SelectedCells[0].RowIndex;
|
||||
var targetObject = new T();
|
||||
|
||||
Type objectType = typeof(T);
|
||||
|
||||
PropertyInfo[] properties = objectType.GetProperties();
|
||||
|
||||
foreach (PropertyInfo property in properties)
|
||||
{
|
||||
DataGridViewCell selectedCell = dataGridView.Rows[rowIndex].Cells[property.Name];
|
||||
|
||||
object cellValue = selectedCell.Value;
|
||||
|
||||
if (cellValue != null && property.CanWrite)
|
||||
{
|
||||
object convertedValue = Convert.ChangeType(cellValue, property.PropertyType);
|
||||
|
||||
property.SetValue(targetObject, convertedValue);
|
||||
}
|
||||
}
|
||||
|
||||
return targetObject;
|
||||
}
|
||||
|
||||
//полная очистка
|
||||
public void ClearTable()
|
||||
{
|
||||
dataGridView.Rows.Clear();
|
||||
}
|
||||
}
|
||||
}
|
120
VisualComponentsLib/MyDataGridView.resx
Normal file
120
VisualComponentsLib/MyDataGridView.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
61
VisualComponentsLib/MyListBox.Designer.cs
generated
Normal file
61
VisualComponentsLib/MyListBox.Designer.cs
generated
Normal file
@ -0,0 +1,61 @@
|
||||
namespace VisualComponentsLib.CustomListBox
|
||||
{
|
||||
partial class MyListBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Обязательная переменная конструктора.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Освободить все используемые ресурсы.
|
||||
/// </summary>
|
||||
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Код, автоматически созданный конструктором компонентов
|
||||
|
||||
/// <summary>
|
||||
/// Требуемый метод для поддержки конструктора — не изменяйте
|
||||
/// содержимое этого метода с помощью редактора кода.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
listBox = new ListBox();
|
||||
SuspendLayout();
|
||||
//
|
||||
// listBox
|
||||
//
|
||||
listBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
listBox.FormattingEnabled = true;
|
||||
listBox.ItemHeight = 15;
|
||||
listBox.Location = new Point(3, 3);
|
||||
listBox.Name = "listBox";
|
||||
listBox.Size = new Size(234, 229);
|
||||
listBox.TabIndex = 0;
|
||||
listBox.SelectedIndexChanged += ListBox_SelectedIndexChanged;
|
||||
//
|
||||
// MyListBox
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Controls.Add(listBox);
|
||||
Location = new Point(3, 5);
|
||||
MinimumSize = new Size(84, 53);
|
||||
Name = "MyListBox";
|
||||
Size = new Size(242, 240);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ListBox listBox;
|
||||
}
|
||||
}
|
71
VisualComponentsLib/MyListBox.cs
Normal file
71
VisualComponentsLib/MyListBox.cs
Normal file
@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace VisualComponentsLib.CustomListBox
|
||||
{
|
||||
[DefaultEvent(nameof(TextChanged))]
|
||||
public partial class MyListBox : UserControl
|
||||
{
|
||||
[Browsable(true)]
|
||||
public string SelectedString
|
||||
{
|
||||
get
|
||||
{
|
||||
if (listBox.SelectedItems.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return listBox.SelectedItem.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value) && listBox.Items.IndexOf(value) != -1)
|
||||
{
|
||||
listBox.SelectedItem = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MyListBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void AddItem(string item)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item))
|
||||
{
|
||||
listBox.Items.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearAll()
|
||||
{
|
||||
listBox.Items.Clear();
|
||||
}
|
||||
|
||||
private EventHandler _textChanged;
|
||||
|
||||
public event EventHandler? TextChanged
|
||||
{
|
||||
add => _textChanged += value;
|
||||
remove => _textChanged -= value;
|
||||
}
|
||||
|
||||
private void ListBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
_textChanged?.Invoke(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
120
VisualComponentsLib/MyListBox.resx
Normal file
120
VisualComponentsLib/MyListBox.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
72
VisualComponentsLib/MyTextBox.Designer.cs
generated
Normal file
72
VisualComponentsLib/MyTextBox.Designer.cs
generated
Normal file
@ -0,0 +1,72 @@
|
||||
namespace VisualComponentsLib
|
||||
{
|
||||
partial class MyTextBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Обязательная переменная конструктора.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Освободить все используемые ресурсы.
|
||||
/// </summary>
|
||||
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Код, автоматически созданный конструктором компонентов
|
||||
|
||||
/// <summary>
|
||||
/// Требуемый метод для поддержки конструктора — не изменяйте
|
||||
/// содержимое этого метода с помощью редактора кода.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
checkBox = new CheckBox();
|
||||
textBox = new TextBox();
|
||||
SuspendLayout();
|
||||
//
|
||||
// checkBox
|
||||
//
|
||||
checkBox.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
checkBox.AutoSize = true;
|
||||
checkBox.Location = new Point(14, 52);
|
||||
checkBox.Name = "checkBox";
|
||||
checkBox.Size = new Size(104, 19);
|
||||
checkBox.TabIndex = 0;
|
||||
checkBox.Text = "Включить null";
|
||||
checkBox.UseVisualStyleBackColor = true;
|
||||
checkBox.CheckedChanged += CheckBox_CheckedChanged_1;
|
||||
//
|
||||
// textBox
|
||||
//
|
||||
textBox.Location = new Point(14, 12);
|
||||
textBox.Name = "textBox";
|
||||
textBox.Size = new Size(182, 23);
|
||||
textBox.TabIndex = 2;
|
||||
textBox.TextChanged += TextBox_TextChanged;
|
||||
//
|
||||
// MyTextBox
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Controls.Add(textBox);
|
||||
Controls.Add(checkBox);
|
||||
Name = "MyTextBox";
|
||||
Size = new Size(210, 80);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private CheckBox checkBox;
|
||||
private TextBox textBox;
|
||||
}
|
||||
}
|
103
VisualComponentsLib/MyTextBox.cs
Normal file
103
VisualComponentsLib/MyTextBox.cs
Normal file
@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using VisualComponentsLib.CustomException;
|
||||
|
||||
namespace VisualComponentsLib
|
||||
{
|
||||
public partial class MyTextBox : UserControl
|
||||
{
|
||||
public double? TextBoxValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (checkBox.Checked)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!CheckValue())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return Convert.ToDouble(textBox.Text);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if(!CheckValue())
|
||||
{
|
||||
textBox.Text = null;
|
||||
}
|
||||
|
||||
textBox.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private string? ErrorMessage
|
||||
{
|
||||
get;
|
||||
|
||||
set;
|
||||
}
|
||||
|
||||
public MyTextBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private EventHandler _textChanged;
|
||||
|
||||
public new event EventHandler? TextChanged
|
||||
{
|
||||
add => _textChanged += value;
|
||||
remove => _textChanged -= value;
|
||||
}
|
||||
|
||||
private void CheckBox_CheckedChanged_1(object sender, EventArgs e)
|
||||
{
|
||||
if (textBox.ReadOnly == true)
|
||||
{
|
||||
textBox.ReadOnly = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
textBox.ReadOnly = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
_textChanged?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
private bool CheckValue()
|
||||
{
|
||||
if (textBox.Text == null && !checkBox.Checked)
|
||||
{
|
||||
ErrorMessage = "Недопустимое значение null";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!textBox.Text.Contains('.') ||
|
||||
textBox.Text.IndexOf('.') == textBox.Text.Length - 1 ||
|
||||
textBox.Text.Length <= 2)
|
||||
{
|
||||
ErrorMessage = "Некорректное double значение";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
120
VisualComponentsLib/MyTextBox.resx
Normal file
120
VisualComponentsLib/MyTextBox.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
11
VisualComponentsLib/VisualComponentsLib.csproj
Normal file
11
VisualComponentsLib/VisualComponentsLib.csproj
Normal file
@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<OutputType>Library</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
58
WinFormsMyComponents/MyButton.Designer.cs
generated
Normal file
58
WinFormsMyComponents/MyButton.Designer.cs
generated
Normal file
@ -0,0 +1,58 @@
|
||||
namespace WinFormsMyComponents
|
||||
{
|
||||
partial class MyButton
|
||||
{
|
||||
/// <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 Component 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()
|
||||
{
|
||||
button1 = new Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
button1.Location = new Point(20, 17);
|
||||
button1.Name = "button1";
|
||||
button1.Size = new Size(75, 23);
|
||||
button1.TabIndex = 0;
|
||||
button1.Text = "Показ";
|
||||
button1.UseVisualStyleBackColor = true;
|
||||
button1.Click += Button1_Click;
|
||||
//
|
||||
// UserControl1
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Controls.Add(button1);
|
||||
Name = "UserControl1";
|
||||
Size = new Size(115, 59);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button button1;
|
||||
}
|
||||
}
|
15
WinFormsMyComponents/MyButton.cs
Normal file
15
WinFormsMyComponents/MyButton.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace WinFormsMyComponents
|
||||
{
|
||||
public partial class MyButton : UserControl
|
||||
{
|
||||
public MyButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("Пробный показ");
|
||||
}
|
||||
}
|
||||
}
|
120
WinFormsMyComponents/MyButton.resx
Normal file
120
WinFormsMyComponents/MyButton.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -1,11 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user