1
This commit is contained in:
parent
6e8ef2fbdd
commit
3b3bdf8168
25
Final/Final.sln
Normal file
25
Final/Final.sln
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.7.34024.191
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Final", "Final\Final.csproj", "{C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C0A1E0DC-D774-4D9A-B23D-205C6BE006C0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {22CF9810-CF49-403F-A1D3-A0A5FDAC4125}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
11
Final/Final/Final.csproj
Normal file
11
Final/Final/Final.csproj
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net7.0-windows</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
138
Final/Final/Form1.Designer.cs
generated
Normal file
138
Final/Final/Form1.Designer.cs
generated
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
namespace Final
|
||||||
|
{
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
tabControl1 = new TabControl();
|
||||||
|
tabPage1 = new TabPage();
|
||||||
|
button2 = new Button();
|
||||||
|
button1 = new Button();
|
||||||
|
listBox1 = new ListBox();
|
||||||
|
tabPage2 = new TabPage();
|
||||||
|
tabPage3 = new TabPage();
|
||||||
|
tabControl1.SuspendLayout();
|
||||||
|
tabPage1.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// tabControl1
|
||||||
|
//
|
||||||
|
tabControl1.Controls.Add(tabPage1);
|
||||||
|
tabControl1.Controls.Add(tabPage2);
|
||||||
|
tabControl1.Controls.Add(tabPage3);
|
||||||
|
tabControl1.Location = new Point(-1, -1);
|
||||||
|
tabControl1.Name = "tabControl1";
|
||||||
|
tabControl1.SelectedIndex = 0;
|
||||||
|
tabControl1.Size = new Size(1154, 666);
|
||||||
|
tabControl1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage1
|
||||||
|
//
|
||||||
|
tabPage1.Controls.Add(button2);
|
||||||
|
tabPage1.Controls.Add(button1);
|
||||||
|
tabPage1.Controls.Add(listBox1);
|
||||||
|
tabPage1.Location = new Point(4, 34);
|
||||||
|
tabPage1.Name = "tabPage1";
|
||||||
|
tabPage1.Padding = new Padding(3);
|
||||||
|
tabPage1.Size = new Size(1146, 628);
|
||||||
|
tabPage1.TabIndex = 0;
|
||||||
|
tabPage1.Text = "Задание 1";
|
||||||
|
tabPage1.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// button2
|
||||||
|
//
|
||||||
|
button2.Location = new Point(223, 417);
|
||||||
|
button2.Name = "button2";
|
||||||
|
button2.Size = new Size(112, 106);
|
||||||
|
button2.TabIndex = 7;
|
||||||
|
button2.Text = "button2";
|
||||||
|
button2.UseVisualStyleBackColor = true;
|
||||||
|
button2.Click += button2_Click;
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
button1.Location = new Point(18, 417);
|
||||||
|
button1.Name = "button1";
|
||||||
|
button1.Size = new Size(112, 106);
|
||||||
|
button1.TabIndex = 6;
|
||||||
|
button1.Text = "button1";
|
||||||
|
button1.UseVisualStyleBackColor = true;
|
||||||
|
button1.Click += button1_Click;
|
||||||
|
//
|
||||||
|
// listBox1
|
||||||
|
//
|
||||||
|
listBox1.FormattingEnabled = true;
|
||||||
|
listBox1.ItemHeight = 25;
|
||||||
|
listBox1.Location = new Point(492, 18);
|
||||||
|
listBox1.Name = "listBox1";
|
||||||
|
listBox1.Size = new Size(648, 579);
|
||||||
|
listBox1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage2
|
||||||
|
//
|
||||||
|
tabPage2.Location = new Point(4, 34);
|
||||||
|
tabPage2.Name = "tabPage2";
|
||||||
|
tabPage2.Padding = new Padding(3);
|
||||||
|
tabPage2.Size = new Size(1146, 628);
|
||||||
|
tabPage2.TabIndex = 1;
|
||||||
|
tabPage2.Text = "1 задание";
|
||||||
|
tabPage2.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// tabPage3
|
||||||
|
//
|
||||||
|
tabPage3.Location = new Point(4, 34);
|
||||||
|
tabPage3.Name = "tabPage3";
|
||||||
|
tabPage3.Padding = new Padding(3);
|
||||||
|
tabPage3.Size = new Size(1146, 628);
|
||||||
|
tabPage3.TabIndex = 2;
|
||||||
|
tabPage3.Text = "tabPage3";
|
||||||
|
tabPage3.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(10F, 25F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(1158, 667);
|
||||||
|
Controls.Add(tabControl1);
|
||||||
|
Name = "Form1";
|
||||||
|
Text = "Form1";
|
||||||
|
tabControl1.ResumeLayout(false);
|
||||||
|
tabPage1.ResumeLayout(false);
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private TabControl tabControl1;
|
||||||
|
private TabPage tabPage1;
|
||||||
|
private TabPage tabPage2;
|
||||||
|
private ListBox listBox1;
|
||||||
|
private Button button2;
|
||||||
|
private Button button1;
|
||||||
|
private TabPage tabPage3;
|
||||||
|
}
|
||||||
|
}
|
40
Final/Final/Form1.cs
Normal file
40
Final/Final/Form1.cs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
namespace Final
|
||||||
|
{
|
||||||
|
public partial class Form1 : Form
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
List<One> ones;
|
||||||
|
|
||||||
|
public Form1()
|
||||||
|
{
|
||||||
|
|
||||||
|
ones = new List<One>();
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
One one = new One("Wood", "Queen", "White", 549.99);
|
||||||
|
ones.Add(one);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
listBox1.Items.Clear();
|
||||||
|
for (int i = 0; i < ones.Count; i++)
|
||||||
|
{
|
||||||
|
listBox1.Items.Add(ones[i].ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
Final/Final/Form1.resx
Normal file
120
Final/Final/Form1.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>
|
37
Final/Final/One.cs
Normal file
37
Final/Final/One.cs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Final;
|
||||||
|
|
||||||
|
public class One
|
||||||
|
{
|
||||||
|
|
||||||
|
public string Material; // Материал, из которого сделана кровать
|
||||||
|
public string Size; // Размер кровати (например, "Queen", "King", "Single")
|
||||||
|
public string Color; // Цвет кровати
|
||||||
|
public double Price; // Цена кровати
|
||||||
|
|
||||||
|
// Конструктор по умолчанию
|
||||||
|
public One() { }
|
||||||
|
|
||||||
|
// Конструктор с параметрами
|
||||||
|
public One(string material, string size, string color, double price)
|
||||||
|
{
|
||||||
|
Material = material;
|
||||||
|
Size = size;
|
||||||
|
Color = color;
|
||||||
|
Price = price;
|
||||||
|
}
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return "Диван << " + "Материал : " + Material + "; " +
|
||||||
|
"Цвет : " + Color + "; " +
|
||||||
|
"Размер : " + Size + "; " +
|
||||||
|
"Цена: " +Price+ " >>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
17
Final/Final/Program.cs
Normal file
17
Final/Final/Program.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace Final
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
|
// see https://aka.ms/applicationconfiguration.
|
||||||
|
ApplicationConfiguration.Initialize();
|
||||||
|
Application.Run(new Form1());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user