Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
74dbe839cb |
BIN
Lab/Arrows/Down.png
Normal file
BIN
Lab/Arrows/Down.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
Lab/Arrows/Left.png
Normal file
BIN
Lab/Arrows/Left.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
Lab/Arrows/Right.png
Normal file
BIN
Lab/Arrows/Right.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
Lab/Arrows/Up.png
Normal file
BIN
Lab/Arrows/Up.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
30
Lab/BaseCar.cs
Normal file
30
Lab/BaseCar.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Lab
|
||||||
|
{
|
||||||
|
public class BaseCar
|
||||||
|
{
|
||||||
|
public int Speed { get; private set; }
|
||||||
|
public double Weight { get; private set; }
|
||||||
|
public Color BodyColor { get; private set; }
|
||||||
|
public Color AdditionalColor { get; private set; }
|
||||||
|
public bool BodyKit { get; private set; }
|
||||||
|
public bool Wing { get; private set; }
|
||||||
|
public bool SportLine { get; private set; }
|
||||||
|
public double Step => (double)Speed * 100 / Weight;
|
||||||
|
public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine)
|
||||||
|
{
|
||||||
|
Speed = speed;
|
||||||
|
Weight = weight;
|
||||||
|
BodyColor = bodyColor;
|
||||||
|
AdditionalColor = additionalColor;
|
||||||
|
BodyKit = bodyKit;
|
||||||
|
Wing = wing;
|
||||||
|
SportLine = sportLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
Lab/Direction.cs
Normal file
16
Lab/Direction.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Lab
|
||||||
|
{
|
||||||
|
public enum Direction
|
||||||
|
{
|
||||||
|
Up = 1,
|
||||||
|
Down = 2,
|
||||||
|
Left = 3,
|
||||||
|
Right = 4
|
||||||
|
}
|
||||||
|
}
|
112
Lab/DrawGasolineTanker.cs
Normal file
112
Lab/DrawGasolineTanker.cs
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Lab
|
||||||
|
{
|
||||||
|
public class DrawGasolineTanker
|
||||||
|
{
|
||||||
|
public BaseCar? GasolineTanker { get; private set; }
|
||||||
|
private int _pictureWidth;
|
||||||
|
private int _pictureHeight;
|
||||||
|
private int _startPosX;
|
||||||
|
private int _startPosY;
|
||||||
|
private readonly int _carWidth = 100;
|
||||||
|
private readonly int _carHeight = 80;
|
||||||
|
|
||||||
|
public bool Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine, int width, int height)
|
||||||
|
{
|
||||||
|
_pictureHeight = height;
|
||||||
|
_pictureWidth = width;
|
||||||
|
GasolineTanker = new BaseCar();
|
||||||
|
GasolineTanker.Init(speed, weight, bodyColor, additionalColor, bodyKit, wing, sportLine);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void SetPosition(int x, int y)
|
||||||
|
{
|
||||||
|
_startPosX = x;
|
||||||
|
_startPosY = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void MoveTransport(Direction direction)
|
||||||
|
{
|
||||||
|
if (GasolineTanker == null)
|
||||||
|
return;
|
||||||
|
switch (direction)
|
||||||
|
{
|
||||||
|
case Direction.Left:
|
||||||
|
{
|
||||||
|
if (_startPosX - GasolineTanker.Step > 0)
|
||||||
|
{
|
||||||
|
_startPosX -= (int)GasolineTanker.Step;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Direction.Up:
|
||||||
|
{
|
||||||
|
if (_startPosY - GasolineTanker.Step > 0)
|
||||||
|
{
|
||||||
|
_startPosY -= (int)GasolineTanker.Step;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Direction.Right:
|
||||||
|
{
|
||||||
|
if (_startPosX + _carWidth + GasolineTanker.Step < _pictureWidth)
|
||||||
|
{
|
||||||
|
_startPosX += (int)GasolineTanker.Step;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Direction.Down:
|
||||||
|
{
|
||||||
|
if (_startPosY + GasolineTanker.Step + _carHeight < _pictureHeight)
|
||||||
|
{
|
||||||
|
_startPosY += (int)GasolineTanker.Step;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DrawTransport(Graphics g)
|
||||||
|
{
|
||||||
|
if (GasolineTanker == null)
|
||||||
|
return;
|
||||||
|
Pen pen = new(GasolineTanker.BodyColor, 2);
|
||||||
|
Brush brush = new SolidBrush(GasolineTanker.BodyColor);
|
||||||
|
if (GasolineTanker.BodyKit)
|
||||||
|
{
|
||||||
|
Brush bodyBrush = new SolidBrush(GasolineTanker.AdditionalColor);
|
||||||
|
g.FillEllipse(bodyBrush, 10 + _startPosX, 10 + _startPosY, 70, 30);
|
||||||
|
}
|
||||||
|
// Отрисовка корпуса
|
||||||
|
g.FillRectangle(brush, 10 + _startPosX, 40 + _startPosY, 90, 20);
|
||||||
|
g.FillRectangle(brush, 80 + _startPosX, 10 + _startPosY, 20, 40);
|
||||||
|
// Отрисовка колесиков
|
||||||
|
g.FillEllipse(brush, 10 + _startPosX, 60 + _startPosY, 20, 20);
|
||||||
|
g.FillEllipse(brush, 30 + _startPosX, 60 + _startPosY, 20, 20);
|
||||||
|
g.FillEllipse(brush, 80 + _startPosX, 60 + _startPosY, 20, 20);
|
||||||
|
if (GasolineTanker.SportLine)
|
||||||
|
{
|
||||||
|
Brush lineBrush = new SolidBrush(GasolineTanker.AdditionalColor);
|
||||||
|
g.FillRectangle(lineBrush, 15 + _startPosX, 45 + _startPosY, 20, 5);
|
||||||
|
g.FillRectangle(lineBrush, 40 + _startPosX, 45 + _startPosY, 20, 5);
|
||||||
|
g.FillRectangle(lineBrush, 65 + _startPosX, 45 + _startPosY, 20, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GasolineTanker.Wing)
|
||||||
|
{
|
||||||
|
Brush lightBrush = new SolidBrush(GasolineTanker.AdditionalColor);
|
||||||
|
g.FillRectangle(lightBrush, 87 + _startPosX, 5 + _startPosY, 5, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
134
Lab/Frame.Designer.cs
generated
Normal file
134
Lab/Frame.Designer.cs
generated
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
namespace Lab
|
||||||
|
{
|
||||||
|
partial class Frame
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
DrawCar = new PictureBox();
|
||||||
|
CreateCarButton = new Button();
|
||||||
|
Up = new Button();
|
||||||
|
Left = new Button();
|
||||||
|
Down = new Button();
|
||||||
|
Right = new Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)DrawCar).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// DrawCar
|
||||||
|
//
|
||||||
|
DrawCar.Dock = DockStyle.Fill;
|
||||||
|
DrawCar.Location = new Point(0, 0);
|
||||||
|
DrawCar.Name = "DrawCar";
|
||||||
|
DrawCar.Size = new Size(882, 553);
|
||||||
|
DrawCar.TabIndex = 1;
|
||||||
|
DrawCar.TabStop = false;
|
||||||
|
//
|
||||||
|
// CreateCarButton
|
||||||
|
//
|
||||||
|
CreateCarButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
|
CreateCarButton.Location = new Point(12, 512);
|
||||||
|
CreateCarButton.Name = "CreateCarButton";
|
||||||
|
CreateCarButton.Size = new Size(94, 29);
|
||||||
|
CreateCarButton.TabIndex = 2;
|
||||||
|
CreateCarButton.Text = "Создать";
|
||||||
|
CreateCarButton.UseVisualStyleBackColor = true;
|
||||||
|
CreateCarButton.Click += CreateCarButton_Click;
|
||||||
|
//
|
||||||
|
// Up
|
||||||
|
//
|
||||||
|
Up.BackgroundImage = Properties.Resources.Up;
|
||||||
|
Up.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
|
Up.Location = new Point(804, 476);
|
||||||
|
Up.Name = "Up";
|
||||||
|
Up.Size = new Size(30, 30);
|
||||||
|
Up.TabIndex = 3;
|
||||||
|
Up.Text = "↑";
|
||||||
|
Up.UseVisualStyleBackColor = true;
|
||||||
|
Up.Click += ButtonMove_Click;
|
||||||
|
//
|
||||||
|
// Left
|
||||||
|
//
|
||||||
|
Left.BackgroundImage = Properties.Resources.Left;
|
||||||
|
Left.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
|
Left.Location = new Point(768, 512);
|
||||||
|
Left.Name = "Left";
|
||||||
|
Left.Size = new Size(30, 30);
|
||||||
|
Left.TabIndex = 4;
|
||||||
|
Left.Text = "←";
|
||||||
|
Left.UseVisualStyleBackColor = true;
|
||||||
|
Left.Click += ButtonMove_Click;
|
||||||
|
//
|
||||||
|
// Down
|
||||||
|
//
|
||||||
|
Down.BackgroundImage = Properties.Resources.Down;
|
||||||
|
Down.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
|
Down.Location = new Point(804, 512);
|
||||||
|
Down.Name = "Down";
|
||||||
|
Down.Size = new Size(30, 30);
|
||||||
|
Down.TabIndex = 5;
|
||||||
|
Down.Text = "↓";
|
||||||
|
Down.UseVisualStyleBackColor = true;
|
||||||
|
Down.Click += ButtonMove_Click;
|
||||||
|
//
|
||||||
|
// Right
|
||||||
|
//
|
||||||
|
Right.BackgroundImage = Properties.Resources.Right;
|
||||||
|
Right.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
|
Right.Location = new Point(840, 512);
|
||||||
|
Right.Name = "Right";
|
||||||
|
Right.Size = new Size(30, 30);
|
||||||
|
Right.TabIndex = 6;
|
||||||
|
Right.Text = "→";
|
||||||
|
Right.UseVisualStyleBackColor = true;
|
||||||
|
Right.Click += ButtonMove_Click;
|
||||||
|
//
|
||||||
|
// Frame
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(882, 553);
|
||||||
|
Controls.Add(Right);
|
||||||
|
Controls.Add(Down);
|
||||||
|
Controls.Add(Left);
|
||||||
|
Controls.Add(Up);
|
||||||
|
Controls.Add(CreateCarButton);
|
||||||
|
Controls.Add(DrawCar);
|
||||||
|
Name = "Frame";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "GasolineTanker";
|
||||||
|
((System.ComponentModel.ISupportInitialize)DrawCar).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private PictureBox DrawCar;
|
||||||
|
private Button CreateCarButton;
|
||||||
|
private Button Up;
|
||||||
|
private Button Left;
|
||||||
|
private Button Down;
|
||||||
|
private Button Right;
|
||||||
|
}
|
||||||
|
}
|
52
Lab/Frame.cs
Normal file
52
Lab/Frame.cs
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
namespace Lab
|
||||||
|
{
|
||||||
|
public partial class Frame : Form
|
||||||
|
{
|
||||||
|
private DrawGasolineTanker? _drawingSportCar;
|
||||||
|
public Frame()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Draw()
|
||||||
|
{
|
||||||
|
if (_drawingSportCar == null)
|
||||||
|
return;
|
||||||
|
Bitmap bitmap = new(DrawCar.Width, DrawCar.Height);
|
||||||
|
Graphics g = Graphics.FromImage(bitmap);
|
||||||
|
_drawingSportCar.DrawTransport(g);
|
||||||
|
DrawCar.Image = bitmap;
|
||||||
|
}
|
||||||
|
private void CreateCarButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Random rnd = new();
|
||||||
|
_drawingSportCar = new();
|
||||||
|
_drawingSportCar.Init(rnd.Next(100, 200), rnd.Next(2000, 4000),
|
||||||
|
Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)),
|
||||||
|
Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)),
|
||||||
|
Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)),
|
||||||
|
DrawCar.Width, DrawCar.Height);
|
||||||
|
_drawingSportCar.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100));
|
||||||
|
Draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonMove_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (_drawingSportCar == null)
|
||||||
|
return;
|
||||||
|
string name = ((Button)sender)?.Name ?? string.Empty;
|
||||||
|
switch (name)
|
||||||
|
{
|
||||||
|
case "Up":
|
||||||
|
_drawingSportCar.MoveTransport(Direction.Up); break;
|
||||||
|
case "Down":
|
||||||
|
_drawingSportCar.MoveTransport(Direction.Down); break;
|
||||||
|
case "Left":
|
||||||
|
_drawingSportCar.MoveTransport(Direction.Left); break;
|
||||||
|
case "Right":
|
||||||
|
_drawingSportCar.MoveTransport(Direction.Right); break;
|
||||||
|
}
|
||||||
|
Draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
Lab/Frame.resx
Normal file
120
Lab/Frame.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>
|
26
Lab/Lab.csproj
Normal file
26
Lab/Lab.csproj
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<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>
|
||||||
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Update="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
25
Lab/Lab.sln
Normal file
25
Lab/Lab.sln
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.7.34009.444
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lab", "Lab.csproj", "{7EA8E822-6F7A-476A-9281-CBCB69B9CAD8}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{7EA8E822-6F7A-476A-9281-CBCB69B9CAD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{7EA8E822-6F7A-476A-9281-CBCB69B9CAD8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{7EA8E822-6F7A-476A-9281-CBCB69B9CAD8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{7EA8E822-6F7A-476A-9281-CBCB69B9CAD8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {01673CC0-0038-41A0-BBEB-C63858590694}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
17
Lab/Program.cs
Normal file
17
Lab/Program.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace Lab
|
||||||
|
{
|
||||||
|
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 Frame());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
103
Lab/Properties/Resources.Designer.cs
generated
Normal file
103
Lab/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Этот код создан программой.
|
||||||
|
// Исполняемая версия:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||||
|
// повторной генерации кода.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Lab.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||||
|
/// </summary>
|
||||||
|
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||||
|
// с помощью такого средства, как ResGen или Visual Studio.
|
||||||
|
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||||
|
// с параметром /str или перестройте свой проект VS.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Lab.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||||
|
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Down {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Down", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Left {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Left", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Right {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Right", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Up {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Up", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
133
Lab/Properties/Resources.resx
Normal file
133
Lab/Properties/Resources.resx
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
<?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>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Arrows\Down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="Left" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Arrows\Left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="Right" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Arrows\Right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Arrows\Up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
Loading…
x
Reference in New Issue
Block a user