Добавление автомобилей
This commit is contained in:
240
Controls/CarItem.Designer.cs
generated
Normal file
240
Controls/CarItem.Designer.cs
generated
Normal file
@@ -0,0 +1,240 @@
|
||||
namespace GtaVUsersInfo.Controls
|
||||
{
|
||||
partial class CarItem
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel6 = new System.Windows.Forms.Panel();
|
||||
this.PhotoBox = new System.Windows.Forms.PictureBox();
|
||||
this.panel5 = new System.Windows.Forms.Panel();
|
||||
this.MoneyTextBox = new System.Windows.Forms.TextBox();
|
||||
this.MoneyLabel = new System.Windows.Forms.Label();
|
||||
this.panel4 = new System.Windows.Forms.Panel();
|
||||
this.ClassLabel = new System.Windows.Forms.Label();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.ManufacturerLabel = new System.Windows.Forms.Label();
|
||||
this.NameLabel = new System.Windows.Forms.Label();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.ModelLabel = new System.Windows.Forms.Label();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel6.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.PhotoBox)).BeginInit();
|
||||
this.panel5.SuspendLayout();
|
||||
this.panel4.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.panel6);
|
||||
this.panel1.Controls.Add(this.panel5);
|
||||
this.panel1.Controls.Add(this.panel4);
|
||||
this.panel1.Controls.Add(this.panel3);
|
||||
this.panel1.Controls.Add(this.panel2);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(212, 206);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// panel6
|
||||
//
|
||||
this.panel6.Controls.Add(this.PhotoBox);
|
||||
this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel6.Location = new System.Drawing.Point(0, 13);
|
||||
this.panel6.Name = "panel6";
|
||||
this.panel6.Size = new System.Drawing.Size(212, 134);
|
||||
this.panel6.TabIndex = 4;
|
||||
//
|
||||
// PhotoBox
|
||||
//
|
||||
this.PhotoBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.PhotoBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.PhotoBox.Name = "PhotoBox";
|
||||
this.PhotoBox.Size = new System.Drawing.Size(212, 134);
|
||||
this.PhotoBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.PhotoBox.TabIndex = 0;
|
||||
this.PhotoBox.TabStop = false;
|
||||
//
|
||||
// panel5
|
||||
//
|
||||
this.panel5.AutoSize = true;
|
||||
this.panel5.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.panel5.Controls.Add(this.MoneyTextBox);
|
||||
this.panel5.Controls.Add(this.MoneyLabel);
|
||||
this.panel5.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel5.Location = new System.Drawing.Point(0, 147);
|
||||
this.panel5.Name = "panel5";
|
||||
this.panel5.Size = new System.Drawing.Size(212, 33);
|
||||
this.panel5.TabIndex = 3;
|
||||
//
|
||||
// MoneyTextBox
|
||||
//
|
||||
this.MoneyTextBox.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.MoneyTextBox.Location = new System.Drawing.Point(0, 13);
|
||||
this.MoneyTextBox.Name = "MoneyTextBox";
|
||||
this.MoneyTextBox.Size = new System.Drawing.Size(212, 20);
|
||||
this.MoneyTextBox.TabIndex = 1;
|
||||
this.MoneyTextBox.Enter += new System.EventHandler(this.carPrice_Enter);
|
||||
this.MoneyTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.carPrice_KeyPress);
|
||||
this.MoneyTextBox.Leave += new System.EventHandler(this.carPrice_Leave);
|
||||
//
|
||||
// MoneyLabel
|
||||
//
|
||||
this.MoneyLabel.AutoSize = true;
|
||||
this.MoneyLabel.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.MoneyLabel.Location = new System.Drawing.Point(0, 0);
|
||||
this.MoneyLabel.Name = "MoneyLabel";
|
||||
this.MoneyLabel.Size = new System.Drawing.Size(48, 13);
|
||||
this.MoneyLabel.TabIndex = 0;
|
||||
this.MoneyLabel.Text = "Деньги:";
|
||||
//
|
||||
// panel4
|
||||
//
|
||||
this.panel4.AutoSize = true;
|
||||
this.panel4.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.panel4.Controls.Add(this.ClassLabel);
|
||||
this.panel4.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel4.Location = new System.Drawing.Point(0, 180);
|
||||
this.panel4.Name = "panel4";
|
||||
this.panel4.Size = new System.Drawing.Size(212, 13);
|
||||
this.panel4.TabIndex = 2;
|
||||
//
|
||||
// ClassLabel
|
||||
//
|
||||
this.ClassLabel.AutoSize = true;
|
||||
this.ClassLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ClassLabel.Location = new System.Drawing.Point(0, 0);
|
||||
this.ClassLabel.Name = "ClassLabel";
|
||||
this.ClassLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.ClassLabel.TabIndex = 0;
|
||||
this.ClassLabel.Text = "label2";
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.AutoSize = true;
|
||||
this.panel3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.panel3.Controls.Add(this.ManufacturerLabel);
|
||||
this.panel3.Controls.Add(this.NameLabel);
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel3.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(212, 13);
|
||||
this.panel3.TabIndex = 1;
|
||||
//
|
||||
// ManufacturerLabel
|
||||
//
|
||||
this.ManufacturerLabel.AutoSize = true;
|
||||
this.ManufacturerLabel.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.ManufacturerLabel.Location = new System.Drawing.Point(177, 0);
|
||||
this.ManufacturerLabel.Name = "ManufacturerLabel";
|
||||
this.ManufacturerLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.ManufacturerLabel.TabIndex = 1;
|
||||
this.ManufacturerLabel.Text = "label1";
|
||||
//
|
||||
// NameLabel
|
||||
//
|
||||
this.NameLabel.AutoSize = true;
|
||||
this.NameLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.NameLabel.Location = new System.Drawing.Point(0, 0);
|
||||
this.NameLabel.Name = "NameLabel";
|
||||
this.NameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.NameLabel.TabIndex = 0;
|
||||
this.NameLabel.Text = "label1";
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.AutoSize = true;
|
||||
this.panel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.panel2.Controls.Add(this.ModelLabel);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 193);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(212, 13);
|
||||
this.panel2.TabIndex = 0;
|
||||
//
|
||||
// ModelLabel
|
||||
//
|
||||
this.ModelLabel.AutoSize = true;
|
||||
this.ModelLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ModelLabel.Location = new System.Drawing.Point(0, 0);
|
||||
this.ModelLabel.Name = "ModelLabel";
|
||||
this.ModelLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.ModelLabel.TabIndex = 0;
|
||||
this.ModelLabel.Text = "label2";
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4);
|
||||
//
|
||||
// CarItem
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "CarItem";
|
||||
this.Size = new System.Drawing.Size(212, 206);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel6.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.PhotoBox)).EndInit();
|
||||
this.panel5.ResumeLayout(false);
|
||||
this.panel5.PerformLayout();
|
||||
this.panel4.ResumeLayout(false);
|
||||
this.panel4.PerformLayout();
|
||||
this.panel3.ResumeLayout(false);
|
||||
this.panel3.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Panel panel5;
|
||||
private System.Windows.Forms.Label MoneyLabel;
|
||||
private System.Windows.Forms.Panel panel4;
|
||||
private System.Windows.Forms.Label ClassLabel;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.Label NameLabel;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Label ModelLabel;
|
||||
private System.Windows.Forms.Panel panel6;
|
||||
private System.Windows.Forms.PictureBox PhotoBox;
|
||||
private System.Windows.Forms.Label ManufacturerLabel;
|
||||
private System.Windows.Forms.TextBox MoneyTextBox;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||
}
|
||||
}
|
87
Controls/CarItem.cs
Normal file
87
Controls/CarItem.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using GtaVUsersInfo.Helpers;
|
||||
|
||||
namespace GtaVUsersInfo.Controls
|
||||
{
|
||||
public partial class CarItem : UserControl
|
||||
{
|
||||
private static readonly HttpClient httpClient = new HttpClient();
|
||||
|
||||
public CarItem(Car carItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
NameLabel.Text = carItem.Name;
|
||||
ClassLabel.Text = carItem.Class;
|
||||
ModelLabel.Text = "Модель:" + carItem.Model;
|
||||
ManufacturerLabel.Text = carItem.Manufacturer;
|
||||
MoneyTextBox.Text = '$' + carItem.Price.ToString();
|
||||
|
||||
LoadImageAsync(carItem.Photo);
|
||||
}
|
||||
|
||||
private async void LoadImageAsync(string imageUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] imageBytes = await httpClient.GetByteArrayAsync(imageUrl);
|
||||
|
||||
using (var ms = new MemoryStream(imageBytes))
|
||||
{
|
||||
var bitmap = new Bitmap(ms);
|
||||
SetImage(bitmap);
|
||||
}
|
||||
}
|
||||
catch (HttpRequestException ex)
|
||||
{
|
||||
ErrorsShow.ShowErrorMessage($"Ошибка HTTP: {ex.Message}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrorsShow.ShowErrorMessage($"Произошла неожиданная ошибка: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void SetImage(Image image)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
{
|
||||
Invoke(new Action<Image>(SetImage), image);
|
||||
}
|
||||
else
|
||||
{
|
||||
PhotoBox.Image = image;
|
||||
}
|
||||
}
|
||||
|
||||
private void carPrice_Enter(object sender, EventArgs e)
|
||||
{
|
||||
(sender as TextBox).Text = (sender as TextBox).Text.Trim('$');
|
||||
}
|
||||
|
||||
private void carPrice_Leave(object sender, EventArgs e)
|
||||
{
|
||||
(sender as TextBox).Text = '$' + (sender as TextBox).Text;
|
||||
}
|
||||
|
||||
private void carPrice_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (e.KeyChar == (char)Keys.Enter)
|
||||
{
|
||||
NameLabel.Focus();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
123
Controls/CarItem.resx
Normal file
123
Controls/CarItem.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
90
Controls/ParameterControl.Designer.cs
generated
Normal file
90
Controls/ParameterControl.Designer.cs
generated
Normal file
@@ -0,0 +1,90 @@
|
||||
namespace GtaVUsersInfo.Controls
|
||||
{
|
||||
partial class ParameterControl
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
this.namePanel = new System.Windows.Forms.Panel();
|
||||
this.Textbox = new System.Windows.Forms.TextBox();
|
||||
this.Label = new System.Windows.Forms.Label();
|
||||
this.namePanel.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// namePanel
|
||||
//
|
||||
this.namePanel.AutoSize = true;
|
||||
this.namePanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.namePanel.Controls.Add(this.Textbox);
|
||||
this.namePanel.Controls.Add(this.Label);
|
||||
this.namePanel.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.namePanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.namePanel.Name = "namePanel";
|
||||
this.namePanel.Padding = new System.Windows.Forms.Padding(2);
|
||||
this.namePanel.Size = new System.Drawing.Size(150, 37);
|
||||
this.namePanel.TabIndex = 2;
|
||||
//
|
||||
// Textbox
|
||||
//
|
||||
this.Textbox.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.Textbox.Location = new System.Drawing.Point(2, 15);
|
||||
this.Textbox.Multiline = true;
|
||||
this.Textbox.Name = "Textbox";
|
||||
this.Textbox.Size = new System.Drawing.Size(146, 20);
|
||||
this.Textbox.TabIndex = 1;
|
||||
//
|
||||
// Label
|
||||
//
|
||||
this.Label.AutoSize = true;
|
||||
this.Label.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.Label.Location = new System.Drawing.Point(2, 2);
|
||||
this.Label.Name = "Label";
|
||||
this.Label.Size = new System.Drawing.Size(32, 13);
|
||||
this.Label.TabIndex = 0;
|
||||
this.Label.Text = "Имя:";
|
||||
//
|
||||
// ParameterControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.Controls.Add(this.namePanel);
|
||||
this.Name = "ParameterControl";
|
||||
this.Size = new System.Drawing.Size(150, 37);
|
||||
this.namePanel.ResumeLayout(false);
|
||||
this.namePanel.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel namePanel;
|
||||
private System.Windows.Forms.TextBox Textbox;
|
||||
private System.Windows.Forms.Label Label;
|
||||
}
|
||||
}
|
23
Controls/ParameterControl.cs
Normal file
23
Controls/ParameterControl.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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 GtaVUsersInfo.Controls
|
||||
{
|
||||
public partial class ParameterControl : UserControl
|
||||
{
|
||||
public ParameterControl(string name, string text = "")
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Label.Text = name + ':';
|
||||
Textbox.Text = text;
|
||||
}
|
||||
}
|
||||
}
|
120
Controls/ParameterControl.resx
Normal file
120
Controls/ParameterControl.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>
|
Reference in New Issue
Block a user