6 Commits
Lab05 ... Lab06

Author SHA1 Message Date
392ec99260 правки 2024-06-03 20:52:48 +04:00
141054fabe 13 2024-06-03 20:47:03 +04:00
b8c4c3ff24 revert f00f29a6cf
revert правки
2024-06-02 15:05:13 +04:00
f00f29a6cf правки 2024-06-02 14:56:03 +04:00
c61f10fa34 Lab06 Finish 2024-05-21 01:03:29 +04:00
ed6631e1ea Class finish 2024-05-21 00:47:54 +04:00
15 changed files with 508 additions and 130 deletions

View File

@@ -53,7 +53,7 @@ public abstract class AbstractCompany
_pictureWidth = picWidth; _pictureWidth = picWidth;
_pictureHeight = picHeight; _pictureHeight = picHeight;
_collection = collection; _collection = collection;
_collection.SetMaxCount = GetMaxCount; _collection.MaxCount = GetMaxCount;
} }
/// <summary> /// <summary>

View File

@@ -1,4 +1,5 @@
using System; using AirBomber.CollectionGenericObjects;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@@ -15,7 +16,7 @@ public interface ICollectionGenericObjects<T>
/// <summary> /// <summary>
/// Установка максимального количества элементов /// Установка максимального количества элементов
/// </summary> /// </summary>
int SetMaxCount { set; } int MaxCount { get; set; }
/// <summary> /// <summary>
/// Добавление объекта в коллекцию /// Добавление объекта в коллекцию
@@ -45,4 +46,15 @@ public interface ICollectionGenericObjects<T>
/// <param name="position">Позиция</param> /// <param name="position">Позиция</param>
/// <returns>Объект</returns> /// <returns>Объект</returns>
T? Get(int position); T? Get(int position);
/// <summary>
/// Получение типа коллекции
/// </summary>
CollectionType GetCollectionType { get; }
/// <summary>
/// Поэлементный вывод элементов коллекции
/// </summary>
/// <returns></returns>
IEnumerable<T?> GetItems();
} }

View File

@@ -16,7 +16,19 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
private int _maxCount; private int _maxCount;
public int Count => _collection.Count; public int Count => _collection.Count;
public int SetMaxCount { set { if (value > 0) { _maxCount = value; } } } public int MaxCount
{
get => _maxCount;
set
{
if (value > 0)
{
_maxCount = value;
}
}
}
public CollectionType GetCollectionType => CollectionType.List;
/// <summary> /// <summary>
/// Конструктор /// Конструктор
@@ -64,4 +76,12 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
_collection.RemoveAt(position); _collection.RemoveAt(position);
return obj; return obj;
} }
public IEnumerable<T?> GetItems()
{
for (int i = 0; i < _collection.Count; ++i)
{
yield return _collection[i];
}
}
} }

View File

@@ -15,8 +15,12 @@ where T : class
public int Count => _collection.Length; public int Count => _collection.Length;
public int SetMaxCount public int MaxCount
{ {
get
{
return _collection.Length;
}
set set
{ {
if (value > 0) if (value > 0)
@@ -33,6 +37,8 @@ where T : class
} }
} }
public CollectionType GetCollectionType => CollectionType.Massive;
/// <summary> /// <summary>
/// Конструктор /// Конструктор
/// </summary> /// </summary>
@@ -106,4 +112,12 @@ where T : class
_collection[position] = null; _collection[position] = null;
return obj; return obj;
} }
public IEnumerable<T?> GetItems()
{
for (int i = 0; i < _collection.Length; ++i)
{
yield return _collection[i];
}
}
} }

View File

@@ -1,4 +1,5 @@
using System; using AirBomber.Drawnings;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@@ -10,7 +11,7 @@ namespace AirBomber.CollectionGenericObjects;
/// </summary> /// </summary>
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
public class StorageCollection<T> public class StorageCollection<T>
where T : class where T : DrawningAirPlane
{ {
/// <summary> /// <summary>
/// Словарь (хранилище) с коллекциями /// Словарь (хранилище) с коллекциями
@@ -22,6 +23,21 @@ public class StorageCollection<T>
/// </summary> /// </summary>
public List<string> Keys => _storages.Keys.ToList(); public List<string> Keys => _storages.Keys.ToList();
/// <summary>
/// Ключевое слово, с которого должен начинаться файл
/// </summary>
private readonly string _collectionKey = "CollectionsStorage";
/// <summary>
/// Разделитель для записи ключа и значения элемента словаря
/// </summary>
private readonly string _separatorForKeyValue = "|";
/// <summary>
/// Разделитель для записей коллекции данных в файл
/// </summary>
private readonly string _separatorItems = ";";
/// <summary> /// <summary>
/// Конструктор /// Конструктор
/// </summary> /// </summary>
@@ -83,4 +99,118 @@ public class StorageCollection<T>
return null; return null;
} }
} }
/// <summary>
/// Сохранение информации по автомобилям в хранилище в файл
/// </summary>
/// <param name="filename">Путь и имя файла</param>
/// <returns>true - сохранение прошло успешно, false - ошибка при сохранении данных</returns>
public bool SaveData(string filename)
{
if (_storages.Count == 0)
{
return false;
}
if (File.Exists(filename))
{
File.Delete(filename);
}
StringBuilder sb = new();
using (StreamWriter sw = new StreamWriter(filename))
{
sw.WriteLine(_collectionKey.ToString());
foreach (KeyValuePair<string, ICollectionGenericObjects<T>> kvpair in _storages)
{
// не сохраняем пустые коллекции
if (kvpair.Value.Count == 0)
continue;
sb.Append(kvpair.Key);
sb.Append(_separatorForKeyValue);
sb.Append(kvpair.Value.GetCollectionType);
sb.Append(_separatorForKeyValue);
sb.Append(kvpair.Value.MaxCount);
sb.Append(_separatorForKeyValue);
foreach (T? item in kvpair.Value.GetItems())
{
string data = item?.GetDataForSave() ?? string.Empty;
if (string.IsNullOrEmpty(data))
continue;
sb.Append(data);
sb.Append(_separatorItems);
}
sw.WriteLine(sb.ToString());
sb.Clear();
}
}
return true;
}
/// <summary>
/// Загрузка информации по автомобилям в хранилище из файла
/// </summary>
/// <param name="filename">Путь и имя файла</param>
/// <returns>true - загрузка прошла успешно, false - ошибка при загрузке данных</returns>
public bool LoadData(string filename)
{
if (!File.Exists(filename))
{
return false;
}
using (StreamReader sr = new StreamReader(filename))
{
string? str;
str = sr.ReadLine();
if (str != _collectionKey.ToString())
return false;
_storages.Clear();
while ((str = sr.ReadLine()) != null)
{
string[] record = str.Split(_separatorForKeyValue);
if (record.Length != 4)
{
continue;
}
CollectionType collectionType = (CollectionType)Enum.Parse(typeof(CollectionType), record[1]);
ICollectionGenericObjects<T>? collection = StorageCollection<T>.CreateCollection(collectionType);
if (collection == null)
{
return false;
}
collection.MaxCount = Convert.ToInt32(record[2]);
string[] set = record[3].Split(_separatorItems, StringSplitOptions.RemoveEmptyEntries);
foreach (string elem in set)
{
if (elem?.CreateDrawningAirPlane() is T boat)
{
if (collection.Insert(boat) == -1)
return false;
}
}
_storages.Add(record[0], collection);
}
}
return true;
}
/// <summary>
/// Создание коллекции по типу
/// </summary>
/// <param name="collectionType"></param>
/// <returns></returns>
private static ICollectionGenericObjects<T>? CreateCollection(CollectionType collectionType)
{
return collectionType switch
{
CollectionType.Massive => new MassiveGenericObjects<T>(),
CollectionType.List => new ListGenericObjects<T>(),
_ => null,
};
}
} }

View File

@@ -28,6 +28,14 @@ public class DrawningAirBomber : DrawningAirPlane
EntityAirPlane = new EntityAirBomber(speed, weight, bodyColor, additionalColor, bombs, fuelTanks); EntityAirPlane = new EntityAirBomber(speed, weight, bodyColor, additionalColor, bombs, fuelTanks);
} }
/// <summary>
/// Конструктор через сущность
/// </summary>
/// <param name="entityAirPlane"></param>
public DrawningAirBomber(EntityAirPlane entityAirPlane) : base()
{
EntityAirPlane = entityAirPlane;
}
public override void DrawTransport(Graphics g) public override void DrawTransport(Graphics g)
{ {
if (EntityAirPlane == null || EntityAirPlane is not EntityAirBomber airbomber || !_startPosX.HasValue || !_startPosY.HasValue) if (EntityAirPlane == null || EntityAirPlane is not EntityAirBomber airbomber || !_startPosX.HasValue || !_startPosY.HasValue)

View File

@@ -69,7 +69,7 @@ public class DrawningAirPlane
/// Пустой конструктор /// Пустой конструктор
/// </summary> /// </summary>
/// ///
private DrawningAirPlane() protected DrawningAirPlane()
{ {
_pictureHeight = null; _pictureHeight = null;
_pictureHeight = null; _pictureHeight = null;
@@ -92,12 +92,21 @@ public class DrawningAirPlane
/// </summary> /// </summary>
/// <param name="drawningAirBomberWidth">Ширина прорисовки самолета</param> /// <param name="drawningAirBomberWidth">Ширина прорисовки самолета</param>
/// <param name="drawningAirBomberWidth">Высота прорисовки самолета</param> /// <param name="drawningAirBomberWidth">Высота прорисовки самолета</param>
protected DrawningAirPlane(int drawningAirBomberWidth, int drawningAirBomberHeight) : this() public DrawningAirPlane(int drawningAirBomberWidth, int drawningAirBomberHeight) : this()
{ {
_drawningAirPlaneHeight = drawningAirBomberHeight; _drawningAirPlaneHeight = drawningAirBomberHeight;
_drawningAirPlaneWidth = drawningAirBomberWidth; _drawningAirPlaneWidth = drawningAirBomberWidth;
} }
/// <summary>
/// Конструктор через сущность
/// </summary>
/// <param name="entityAirPlane"></param>
public DrawningAirPlane(EntityAirPlane entityAirPlane) : base()
{
EntityAirPlane = entityAirPlane;
}
/// <summary> /// <summary>
/// Установка границ поля /// Установка границ поля
/// </summary> /// </summary>

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AirBomber.Entities;
namespace AirBomber.Drawnings;
public static class ExtentionDrawningAirPlane
{
/// <summary>
/// Разделитель для записи информации по объекту в файл
/// </summary>
private static readonly string _separatorForObject = ":";
/// <summary>
/// Создание объекта из строки
/// </summary>
/// <param name="info">Строка с данными для создания объекта</param>
/// <returns>Объект</returns>
public static DrawningAirPlane? CreateDrawningAirPlane(this string info)
{
string[] strs = info.Split(_separatorForObject);
EntityAirPlane? airPlane = EntityAirBomber.CreateEntityAirBomber(strs);
if (airPlane != null)
{
return new DrawningAirBomber(airPlane);
}
airPlane = EntityAirPlane.CreateEntityAirPlane(strs);
if (airPlane != null)
{
return new DrawningAirPlane(airPlane);
}
return null;
}
/// <summary>
/// Получение данных для сохранения в файл
/// </summary>
/// <param name="drawningAirPlane">Сохраняемый объект</param>
/// <returns>Строка с данными по объекту</returns>
public static string GetDataForSave(this DrawningAirPlane drawningAirPlane)
{
string[]? array = drawningAirPlane?.EntityAirPlane?.GetStringRepresentation();
if (array == null)
{
return string.Empty;
}
return string.Join(_separatorForObject, array);
}
}

View File

@@ -37,4 +37,19 @@ public class EntityAirBomber : EntityAirPlane
Bombs = bombs; Bombs = bombs;
FuelTanks = fuelTanks; FuelTanks = fuelTanks;
} }
public override string[] GetStringRepresentation()
{
return new[] { nameof(EntityAirBomber), Speed.ToString(), Weight.ToString(), BodyColor.Name, AdditionalColor.Name, Bombs.ToString(), FuelTanks.ToString() };
}
public static EntityAirBomber? CreateEntityAirBomber(string[] strs)
{
if (strs.Length != 7 || strs[0] != nameof(EntityAirBomber))
{
return null;
}
return new EntityAirBomber(Convert.ToInt32(strs[1]), Convert.ToDouble(strs[2]),
Color.FromName(strs[3]), Color.FromName(strs[4]), Convert.ToBoolean(strs[5]), Convert.ToBoolean(strs[6]));
}
} }

View File

@@ -42,4 +42,28 @@ public class EntityAirPlane
Weight = weight; Weight = weight;
BodyColor = bodyColor; BodyColor = bodyColor;
} }
/// <summary>
/// Получение строк со значениями свойств объекта класса-сущности
/// </summary>
/// <returns></returns>
public virtual string[] GetStringRepresentation()
{
return new[] { nameof(EntityAirPlane), Speed.ToString(), Weight.ToString(), BodyColor.Name };
}
/// <summary>
/// Создание объекта из массива строк
/// </summary>
/// <param name="strs"></param>
/// <returns></returns>
public static EntityAirPlane? CreateEntityAirPlane(string[] strs)
{
if (strs.Length != 4 || strs[0] != nameof(EntityAirPlane))
{
return null;
}
return new EntityAirPlane(Convert.ToInt32(strs[1]), Convert.ToDouble(strs[2]), Color.FromName(strs[3]));
}
} }

View File

@@ -46,10 +46,17 @@
labelCollectionName = new Label(); labelCollectionName = new Label();
comboBoxSelectorCompany = new ComboBox(); comboBoxSelectorCompany = new ComboBox();
pictureBox = new PictureBox(); pictureBox = new PictureBox();
menuStrip = new MenuStrip();
файлToolStripMenuItem = new ToolStripMenuItem();
saveToolStripMenuItem = new ToolStripMenuItem();
loadToolStripMenuItem = new ToolStripMenuItem();
saveFileDialog = new SaveFileDialog();
openFileDialog = new OpenFileDialog();
groupBoxTools.SuspendLayout(); groupBoxTools.SuspendLayout();
panelCompanyTools.SuspendLayout(); panelCompanyTools.SuspendLayout();
panelStorage.SuspendLayout(); panelStorage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBox).BeginInit(); ((System.ComponentModel.ISupportInitialize)pictureBox).BeginInit();
menuStrip.SuspendLayout();
SuspendLayout(); SuspendLayout();
// //
// groupBoxTools // groupBoxTools
@@ -59,9 +66,11 @@
groupBoxTools.Controls.Add(panelStorage); groupBoxTools.Controls.Add(panelStorage);
groupBoxTools.Controls.Add(comboBoxSelectorCompany); groupBoxTools.Controls.Add(comboBoxSelectorCompany);
groupBoxTools.Dock = DockStyle.Right; groupBoxTools.Dock = DockStyle.Right;
groupBoxTools.Location = new Point(752, 0); groupBoxTools.Location = new Point(859, 0);
groupBoxTools.Margin = new Padding(3, 4, 3, 4);
groupBoxTools.Name = "groupBoxTools"; groupBoxTools.Name = "groupBoxTools";
groupBoxTools.Size = new Size(208, 644); groupBoxTools.Padding = new Padding(3, 4, 3, 4);
groupBoxTools.Size = new Size(238, 859);
groupBoxTools.TabIndex = 0; groupBoxTools.TabIndex = 0;
groupBoxTools.TabStop = false; groupBoxTools.TabStop = false;
groupBoxTools.Text = "Инструманты"; groupBoxTools.Text = "Инструманты";
@@ -73,18 +82,18 @@
panelCompanyTools.Controls.Add(buttonRefresh); panelCompanyTools.Controls.Add(buttonRefresh);
panelCompanyTools.Controls.Add(buttonDelAirPlane); panelCompanyTools.Controls.Add(buttonDelAirPlane);
panelCompanyTools.Controls.Add(buttonGoToCheck); panelCompanyTools.Controls.Add(buttonGoToCheck);
panelCompanyTools.Location = new Point(14, 342); panelCompanyTools.Location = new Point(16, 456);
panelCompanyTools.Margin = new Padding(3, 2, 3, 2);
panelCompanyTools.Name = "panelCompanyTools"; panelCompanyTools.Name = "panelCompanyTools";
panelCompanyTools.Size = new Size(184, 214); panelCompanyTools.Size = new Size(210, 285);
panelCompanyTools.TabIndex = 8; panelCompanyTools.TabIndex = 8;
// //
// buttonAddAirPlane // buttonAddAirPlane
// //
buttonAddAirPlane.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; buttonAddAirPlane.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
buttonAddAirPlane.Location = new Point(6, 3); buttonAddAirPlane.Location = new Point(7, 4);
buttonAddAirPlane.Margin = new Padding(3, 4, 3, 4);
buttonAddAirPlane.Name = "buttonAddAirPlane"; buttonAddAirPlane.Name = "buttonAddAirPlane";
buttonAddAirPlane.Size = new Size(175, 41); buttonAddAirPlane.Size = new Size(200, 55);
buttonAddAirPlane.TabIndex = 1; buttonAddAirPlane.TabIndex = 1;
buttonAddAirPlane.Text = "Добавление самолета"; buttonAddAirPlane.Text = "Добавление самолета";
buttonAddAirPlane.UseVisualStyleBackColor = true; buttonAddAirPlane.UseVisualStyleBackColor = true;
@@ -92,18 +101,20 @@
// //
// maskedTextBox // maskedTextBox
// //
maskedTextBox.Location = new Point(6, 98); maskedTextBox.Location = new Point(7, 131);
maskedTextBox.Margin = new Padding(3, 4, 3, 4);
maskedTextBox.Mask = "00"; maskedTextBox.Mask = "00";
maskedTextBox.Name = "maskedTextBox"; maskedTextBox.Name = "maskedTextBox";
maskedTextBox.Size = new Size(176, 23); maskedTextBox.Size = new Size(201, 27);
maskedTextBox.TabIndex = 3; maskedTextBox.TabIndex = 3;
maskedTextBox.ValidatingType = typeof(int); maskedTextBox.ValidatingType = typeof(int);
// //
// buttonRefresh // buttonRefresh
// //
buttonRefresh.Location = new Point(6, 182); buttonRefresh.Location = new Point(7, 243);
buttonRefresh.Margin = new Padding(3, 4, 3, 4);
buttonRefresh.Name = "buttonRefresh"; buttonRefresh.Name = "buttonRefresh";
buttonRefresh.Size = new Size(175, 22); buttonRefresh.Size = new Size(200, 29);
buttonRefresh.TabIndex = 6; buttonRefresh.TabIndex = 6;
buttonRefresh.Text = "Обновить"; buttonRefresh.Text = "Обновить";
buttonRefresh.UseVisualStyleBackColor = true; buttonRefresh.UseVisualStyleBackColor = true;
@@ -112,9 +123,10 @@
// buttonDelAirPlane // buttonDelAirPlane
// //
buttonDelAirPlane.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; buttonDelAirPlane.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
buttonDelAirPlane.Location = new Point(6, 124); buttonDelAirPlane.Location = new Point(7, 165);
buttonDelAirPlane.Margin = new Padding(3, 4, 3, 4);
buttonDelAirPlane.Name = "buttonDelAirPlane"; buttonDelAirPlane.Name = "buttonDelAirPlane";
buttonDelAirPlane.Size = new Size(175, 23); buttonDelAirPlane.Size = new Size(200, 31);
buttonDelAirPlane.TabIndex = 4; buttonDelAirPlane.TabIndex = 4;
buttonDelAirPlane.Text = "Удалить Самолет"; buttonDelAirPlane.Text = "Удалить Самолет";
buttonDelAirPlane.UseVisualStyleBackColor = true; buttonDelAirPlane.UseVisualStyleBackColor = true;
@@ -122,9 +134,10 @@
// //
// buttonGoToCheck // buttonGoToCheck
// //
buttonGoToCheck.Location = new Point(6, 154); buttonGoToCheck.Location = new Point(7, 205);
buttonGoToCheck.Margin = new Padding(3, 4, 3, 4);
buttonGoToCheck.Name = "buttonGoToCheck"; buttonGoToCheck.Name = "buttonGoToCheck";
buttonGoToCheck.Size = new Size(175, 22); buttonGoToCheck.Size = new Size(200, 29);
buttonGoToCheck.TabIndex = 5; buttonGoToCheck.TabIndex = 5;
buttonGoToCheck.Text = "Передать на тесты"; buttonGoToCheck.Text = "Передать на тесты";
buttonGoToCheck.UseVisualStyleBackColor = true; buttonGoToCheck.UseVisualStyleBackColor = true;
@@ -132,10 +145,9 @@
// //
// buttonCreateCompany // buttonCreateCompany
// //
buttonCreateCompany.Location = new Point(14, 274); buttonCreateCompany.Location = new Point(16, 365);
buttonCreateCompany.Margin = new Padding(3, 2, 3, 2);
buttonCreateCompany.Name = "buttonCreateCompany"; buttonCreateCompany.Name = "buttonCreateCompany";
buttonCreateCompany.Size = new Size(181, 37); buttonCreateCompany.Size = new Size(207, 49);
buttonCreateCompany.TabIndex = 7; buttonCreateCompany.TabIndex = 7;
buttonCreateCompany.Text = "Создать компанию"; buttonCreateCompany.Text = "Создать компанию";
buttonCreateCompany.UseVisualStyleBackColor = true; buttonCreateCompany.UseVisualStyleBackColor = true;
@@ -151,18 +163,16 @@
panelStorage.Controls.Add(textBoxCollectionName); panelStorage.Controls.Add(textBoxCollectionName);
panelStorage.Controls.Add(labelCollectionName); panelStorage.Controls.Add(labelCollectionName);
panelStorage.Dock = DockStyle.Top; panelStorage.Dock = DockStyle.Top;
panelStorage.Location = new Point(3, 19); panelStorage.Location = new Point(3, 24);
panelStorage.Margin = new Padding(3, 2, 3, 2);
panelStorage.Name = "panelStorage"; panelStorage.Name = "panelStorage";
panelStorage.Size = new Size(202, 228); panelStorage.Size = new Size(232, 304);
panelStorage.TabIndex = 7; panelStorage.TabIndex = 7;
// //
// buttonCollectionDel // buttonCollectionDel
// //
buttonCollectionDel.Location = new Point(11, 203); buttonCollectionDel.Location = new Point(13, 271);
buttonCollectionDel.Margin = new Padding(3, 2, 3, 2);
buttonCollectionDel.Name = "buttonCollectionDel"; buttonCollectionDel.Name = "buttonCollectionDel";
buttonCollectionDel.Size = new Size(184, 22); buttonCollectionDel.Size = new Size(210, 29);
buttonCollectionDel.TabIndex = 6; buttonCollectionDel.TabIndex = 6;
buttonCollectionDel.Text = "Удалить коллецию"; buttonCollectionDel.Text = "Удалить коллецию";
buttonCollectionDel.UseVisualStyleBackColor = true; buttonCollectionDel.UseVisualStyleBackColor = true;
@@ -171,19 +181,17 @@
// listBoxCollection // listBoxCollection
// //
listBoxCollection.FormattingEnabled = true; listBoxCollection.FormattingEnabled = true;
listBoxCollection.ItemHeight = 15; listBoxCollection.ItemHeight = 20;
listBoxCollection.Location = new Point(3, 121); listBoxCollection.Location = new Point(3, 161);
listBoxCollection.Margin = new Padding(3, 2, 3, 2);
listBoxCollection.Name = "listBoxCollection"; listBoxCollection.Name = "listBoxCollection";
listBoxCollection.Size = new Size(193, 79); listBoxCollection.Size = new Size(220, 104);
listBoxCollection.TabIndex = 5; listBoxCollection.TabIndex = 5;
// //
// buttonCollectionAdd // buttonCollectionAdd
// //
buttonCollectionAdd.Location = new Point(11, 94); buttonCollectionAdd.Location = new Point(13, 125);
buttonCollectionAdd.Margin = new Padding(3, 2, 3, 2);
buttonCollectionAdd.Name = "buttonCollectionAdd"; buttonCollectionAdd.Name = "buttonCollectionAdd";
buttonCollectionAdd.Size = new Size(189, 22); buttonCollectionAdd.Size = new Size(216, 29);
buttonCollectionAdd.TabIndex = 4; buttonCollectionAdd.TabIndex = 4;
buttonCollectionAdd.Text = "Добавить коллецию"; buttonCollectionAdd.Text = "Добавить коллецию";
buttonCollectionAdd.UseVisualStyleBackColor = true; buttonCollectionAdd.UseVisualStyleBackColor = true;
@@ -192,10 +200,9 @@
// radioButtonList // radioButtonList
// //
radioButtonList.AutoSize = true; radioButtonList.AutoSize = true;
radioButtonList.Location = new Point(88, 72); radioButtonList.Location = new Point(101, 96);
radioButtonList.Margin = new Padding(3, 2, 3, 2);
radioButtonList.Name = "radioButtonList"; radioButtonList.Name = "radioButtonList";
radioButtonList.Size = new Size(66, 19); radioButtonList.Size = new Size(80, 24);
radioButtonList.TabIndex = 3; radioButtonList.TabIndex = 3;
radioButtonList.TabStop = true; radioButtonList.TabStop = true;
radioButtonList.Text = "Список"; radioButtonList.Text = "Список";
@@ -204,10 +211,9 @@
// radioButtonMassive // radioButtonMassive
// //
radioButtonMassive.AutoSize = true; radioButtonMassive.AutoSize = true;
radioButtonMassive.Location = new Point(11, 72); radioButtonMassive.Location = new Point(13, 96);
radioButtonMassive.Margin = new Padding(3, 2, 3, 2);
radioButtonMassive.Name = "radioButtonMassive"; radioButtonMassive.Name = "radioButtonMassive";
radioButtonMassive.Size = new Size(67, 19); radioButtonMassive.Size = new Size(82, 24);
radioButtonMassive.TabIndex = 2; radioButtonMassive.TabIndex = 2;
radioButtonMassive.TabStop = true; radioButtonMassive.TabStop = true;
radioButtonMassive.Text = "Массив"; radioButtonMassive.Text = "Массив";
@@ -215,18 +221,17 @@
// //
// textBoxCollectionName // textBoxCollectionName
// //
textBoxCollectionName.Location = new Point(3, 40); textBoxCollectionName.Location = new Point(3, 53);
textBoxCollectionName.Margin = new Padding(3, 2, 3, 2);
textBoxCollectionName.Name = "textBoxCollectionName"; textBoxCollectionName.Name = "textBoxCollectionName";
textBoxCollectionName.Size = new Size(198, 23); textBoxCollectionName.Size = new Size(226, 27);
textBoxCollectionName.TabIndex = 1; textBoxCollectionName.TabIndex = 1;
// //
// labelCollectionName // labelCollectionName
// //
labelCollectionName.AutoSize = true; labelCollectionName.AutoSize = true;
labelCollectionName.Location = new Point(11, 9); labelCollectionName.Location = new Point(13, 12);
labelCollectionName.Name = "labelCollectionName"; labelCollectionName.Name = "labelCollectionName";
labelCollectionName.Size = new Size(119, 15); labelCollectionName.Size = new Size(151, 20);
labelCollectionName.TabIndex = 0; labelCollectionName.TabIndex = 0;
labelCollectionName.Text = "Название коллеции:"; labelCollectionName.Text = "Название коллеции:";
// //
@@ -236,9 +241,10 @@
comboBoxSelectorCompany.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxSelectorCompany.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxSelectorCompany.FormattingEnabled = true; comboBoxSelectorCompany.FormattingEnabled = true;
comboBoxSelectorCompany.Items.AddRange(new object[] { "Хранилище" }); comboBoxSelectorCompany.Items.AddRange(new object[] { "Хранилище" });
comboBoxSelectorCompany.Location = new Point(14, 248); comboBoxSelectorCompany.Location = new Point(16, 331);
comboBoxSelectorCompany.Margin = new Padding(3, 4, 3, 4);
comboBoxSelectorCompany.Name = "comboBoxSelectorCompany"; comboBoxSelectorCompany.Name = "comboBoxSelectorCompany";
comboBoxSelectorCompany.Size = new Size(184, 23); comboBoxSelectorCompany.Size = new Size(210, 28);
comboBoxSelectorCompany.TabIndex = 0; comboBoxSelectorCompany.TabIndex = 0;
comboBoxSelectorCompany.SelectedIndexChanged += comboBoxSelectorCompany_SelectedIndexChanged; comboBoxSelectorCompany.SelectedIndexChanged += comboBoxSelectorCompany_SelectedIndexChanged;
// //
@@ -246,18 +252,64 @@
// //
pictureBox.Dock = DockStyle.Fill; pictureBox.Dock = DockStyle.Fill;
pictureBox.Location = new Point(0, 0); pictureBox.Location = new Point(0, 0);
pictureBox.Margin = new Padding(3, 4, 3, 4);
pictureBox.Name = "pictureBox"; pictureBox.Name = "pictureBox";
pictureBox.Size = new Size(752, 644); pictureBox.Size = new Size(859, 859);
pictureBox.TabIndex = 1; pictureBox.TabIndex = 1;
pictureBox.TabStop = false; pictureBox.TabStop = false;
// //
// menuStrip
//
menuStrip.ImageScalingSize = new Size(20, 20);
menuStrip.Items.AddRange(new ToolStripItem[] { файлToolStripMenuItem });
menuStrip.Location = new Point(0, 0);
menuStrip.Name = "menuStrip";
menuStrip.Padding = new Padding(7, 3, 0, 3);
menuStrip.Size = new Size(859, 30);
menuStrip.TabIndex = 3;
menuStrip.Text = "menuStrip1";
//
// файлToolStripMenuItem
//
файлToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { saveToolStripMenuItem, loadToolStripMenuItem });
файлToolStripMenuItem.Name = айлToolStripMenuItem";
файлToolStripMenuItem.Size = new Size(59, 24);
файлToolStripMenuItem.Text = "Файл";
файлToolStripMenuItem.Click += saveToolStripMenuItem_Click;
//
// saveToolStripMenuItem
//
saveToolStripMenuItem.Name = "saveToolStripMenuItem";
saveToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.S;
saveToolStripMenuItem.Size = new Size(227, 26);
saveToolStripMenuItem.Text = "Сохранение";
saveToolStripMenuItem.Click += saveToolStripMenuItem_Click;
//
// loadToolStripMenuItem
//
loadToolStripMenuItem.Name = "loadToolStripMenuItem";
loadToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.L;
loadToolStripMenuItem.Size = new Size(227, 26);
loadToolStripMenuItem.Text = "Загрузка";
loadToolStripMenuItem.Click += loadToolStripMenuItem_Click;
//
// saveFileDialog
//
saveFileDialog.Filter = "txt file | *.txt";
//
// openFileDialog
//
openFileDialog.Filter = "txt file | *.txt";
//
// FormAirPlaneCollection // FormAirPlaneCollection
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(960, 644); ClientSize = new Size(1097, 859);
Controls.Add(menuStrip);
Controls.Add(pictureBox); Controls.Add(pictureBox);
Controls.Add(groupBoxTools); Controls.Add(groupBoxTools);
Margin = new Padding(3, 4, 3, 4);
Name = "FormAirPlaneCollection"; Name = "FormAirPlaneCollection";
Text = "FormAirPlaneCollection"; Text = "FormAirPlaneCollection";
Load += FormAirPlaneCollection_Load; Load += FormAirPlaneCollection_Load;
@@ -267,7 +319,10 @@
panelStorage.ResumeLayout(false); panelStorage.ResumeLayout(false);
panelStorage.PerformLayout(); panelStorage.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureBox).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureBox).EndInit();
menuStrip.ResumeLayout(false);
menuStrip.PerformLayout();
ResumeLayout(false); ResumeLayout(false);
PerformLayout();
} }
#endregion #endregion
@@ -290,5 +345,11 @@
private ListBox listBoxCollection; private ListBox listBoxCollection;
private Button buttonCreateCompany; private Button buttonCreateCompany;
private Panel panelCompanyTools; private Panel panelCompanyTools;
private MenuStrip menuStrip;
private ToolStripMenuItem файлToolStripMenuItem;
private ToolStripMenuItem saveToolStripMenuItem;
private ToolStripMenuItem loadToolStripMenuItem;
private SaveFileDialog saveFileDialog;
private OpenFileDialog openFileDialog;
} }
} }

View File

@@ -263,5 +263,46 @@ namespace AirBomber
panelCompanyTools.Enabled = true; panelCompanyTools.Enabled = true;
RefreshListBoxItems(); RefreshListBoxItems();
} }
/// <summary>
/// Обработка нажатия "Сохранение"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
if (_storageCollection.SaveData(saveFileDialog.FileName))
{
MessageBox.Show("Сохранение прошло успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Не сохранилось", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
/// <summary>
/// Обработка кнопки загрузки
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void loadToolStripMenuItem_Click(object sender, EventArgs e)
{
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
if (_storageCollection.LoadData(openFileDialog.FileName))
{
RefreshListBoxItems();
MessageBox.Show("Загрузка прошла успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Загрузка не выполнена", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
} }
} }

View File

@@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
@@ -117,4 +117,13 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>126, 17</value>
</metadata>
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>261, 17</value>
</metadata>
</root> </root>

View File

@@ -73,10 +73,8 @@
groupBoxConfig.Controls.Add(labelSimpleObject); groupBoxConfig.Controls.Add(labelSimpleObject);
groupBoxConfig.Dock = DockStyle.Left; groupBoxConfig.Dock = DockStyle.Left;
groupBoxConfig.Location = new Point(0, 0); groupBoxConfig.Location = new Point(0, 0);
groupBoxConfig.Margin = new Padding(3, 4, 3, 4);
groupBoxConfig.Name = "groupBoxConfig"; groupBoxConfig.Name = "groupBoxConfig";
groupBoxConfig.Padding = new Padding(3, 4, 3, 4); groupBoxConfig.Size = new Size(550, 260);
groupBoxConfig.Size = new Size(629, 346);
groupBoxConfig.TabIndex = 0; groupBoxConfig.TabIndex = 0;
groupBoxConfig.TabStop = false; groupBoxConfig.TabStop = false;
groupBoxConfig.Text = "Параметры"; groupBoxConfig.Text = "Параметры";
@@ -91,11 +89,9 @@
groupBoxColors.Controls.Add(panelWhite); groupBoxColors.Controls.Add(panelWhite);
groupBoxColors.Controls.Add(panelGreen); groupBoxColors.Controls.Add(panelGreen);
groupBoxColors.Controls.Add(panelRed); groupBoxColors.Controls.Add(panelRed);
groupBoxColors.Location = new Point(360, 16); groupBoxColors.Location = new Point(315, 12);
groupBoxColors.Margin = new Padding(3, 4, 3, 4);
groupBoxColors.Name = "groupBoxColors"; groupBoxColors.Name = "groupBoxColors";
groupBoxColors.Padding = new Padding(3, 4, 3, 4); groupBoxColors.Size = new Size(227, 112);
groupBoxColors.Size = new Size(259, 149);
groupBoxColors.TabIndex = 11; groupBoxColors.TabIndex = 11;
groupBoxColors.TabStop = false; groupBoxColors.TabStop = false;
groupBoxColors.Text = "Цвета"; groupBoxColors.Text = "Цвета";
@@ -103,83 +99,74 @@
// panelPurple // panelPurple
// //
panelPurple.BackColor = Color.Purple; panelPurple.BackColor = Color.Purple;
panelPurple.Location = new Point(201, 88); panelPurple.Location = new Point(176, 66);
panelPurple.Margin = new Padding(3, 4, 3, 4);
panelPurple.Name = "panelPurple"; panelPurple.Name = "panelPurple";
panelPurple.Size = new Size(39, 45); panelPurple.Size = new Size(34, 34);
panelPurple.TabIndex = 3; panelPurple.TabIndex = 3;
// //
// panelYellow // panelYellow
// //
panelYellow.BackColor = Color.Yellow; panelYellow.BackColor = Color.Yellow;
panelYellow.Location = new Point(201, 29); panelYellow.Location = new Point(176, 22);
panelYellow.Margin = new Padding(3, 4, 3, 4);
panelYellow.Name = "panelYellow"; panelYellow.Name = "panelYellow";
panelYellow.Size = new Size(39, 45); panelYellow.Size = new Size(34, 34);
panelYellow.TabIndex = 1; panelYellow.TabIndex = 1;
// //
// panelBlack // panelBlack
// //
panelBlack.BackColor = Color.Black; panelBlack.BackColor = Color.Black;
panelBlack.Location = new Point(137, 88); panelBlack.Location = new Point(120, 66);
panelBlack.Margin = new Padding(3, 4, 3, 4);
panelBlack.Name = "panelBlack"; panelBlack.Name = "panelBlack";
panelBlack.Size = new Size(39, 45); panelBlack.Size = new Size(34, 34);
panelBlack.TabIndex = 4; panelBlack.TabIndex = 4;
// //
// panelGray // panelGray
// //
panelGray.BackColor = Color.Gray; panelGray.BackColor = Color.Gray;
panelGray.Location = new Point(77, 88); panelGray.Location = new Point(67, 66);
panelGray.Margin = new Padding(3, 4, 3, 4);
panelGray.Name = "panelGray"; panelGray.Name = "panelGray";
panelGray.Size = new Size(39, 45); panelGray.Size = new Size(34, 34);
panelGray.TabIndex = 5; panelGray.TabIndex = 5;
// //
// panelBlue // panelBlue
// //
panelBlue.BackColor = Color.Blue; panelBlue.BackColor = Color.Blue;
panelBlue.Location = new Point(137, 29); panelBlue.Location = new Point(120, 22);
panelBlue.Margin = new Padding(3, 4, 3, 4);
panelBlue.Name = "panelBlue"; panelBlue.Name = "panelBlue";
panelBlue.Size = new Size(39, 45); panelBlue.Size = new Size(34, 34);
panelBlue.TabIndex = 1; panelBlue.TabIndex = 1;
// //
// panelWhite // panelWhite
// //
panelWhite.BackColor = Color.White; panelWhite.BackColor = Color.White;
panelWhite.Location = new Point(17, 88); panelWhite.Location = new Point(15, 66);
panelWhite.Margin = new Padding(3, 4, 3, 4);
panelWhite.Name = "panelWhite"; panelWhite.Name = "panelWhite";
panelWhite.Size = new Size(39, 45); panelWhite.Size = new Size(34, 34);
panelWhite.TabIndex = 2; panelWhite.TabIndex = 2;
// //
// panelGreen // panelGreen
// //
panelGreen.BackColor = Color.Green; panelGreen.BackColor = Color.Green;
panelGreen.Location = new Point(77, 29); panelGreen.Location = new Point(67, 22);
panelGreen.Margin = new Padding(3, 4, 3, 4);
panelGreen.Name = "panelGreen"; panelGreen.Name = "panelGreen";
panelGreen.Size = new Size(39, 45); panelGreen.Size = new Size(34, 34);
panelGreen.TabIndex = 1; panelGreen.TabIndex = 1;
// //
// panelRed // panelRed
// //
panelRed.BackColor = Color.Red; panelRed.BackColor = Color.Red;
panelRed.Location = new Point(17, 29); panelRed.Location = new Point(15, 22);
panelRed.Margin = new Padding(3, 4, 3, 4);
panelRed.Name = "panelRed"; panelRed.Name = "panelRed";
panelRed.Size = new Size(39, 45); panelRed.Size = new Size(34, 34);
panelRed.TabIndex = 0; panelRed.TabIndex = 0;
panelRed.MouseDown += Panel_MouseDown; panelRed.MouseDown += Panel_MouseDown;
// //
// checkBoxFuelTanks // checkBoxFuelTanks
// //
checkBoxFuelTanks.AutoSize = true; checkBoxFuelTanks.AutoSize = true;
checkBoxFuelTanks.Location = new Point(14, 237); checkBoxFuelTanks.Location = new Point(12, 178);
checkBoxFuelTanks.Margin = new Padding(3, 4, 3, 4);
checkBoxFuelTanks.Name = "checkBoxFuelTanks"; checkBoxFuelTanks.Name = "checkBoxFuelTanks";
checkBoxFuelTanks.Size = new Size(312, 24); checkBoxFuelTanks.Size = new Size(248, 19);
checkBoxFuelTanks.TabIndex = 7; checkBoxFuelTanks.TabIndex = 7;
checkBoxFuelTanks.Text = "Признак наличия доп. топливных баков"; checkBoxFuelTanks.Text = "Признак наличия доп. топливных баков";
checkBoxFuelTanks.UseVisualStyleBackColor = true; checkBoxFuelTanks.UseVisualStyleBackColor = true;
@@ -187,60 +174,57 @@
// checkBoxBombs // checkBoxBombs
// //
checkBoxBombs.AutoSize = true; checkBoxBombs.AutoSize = true;
checkBoxBombs.Location = new Point(14, 176); checkBoxBombs.Location = new Point(12, 132);
checkBoxBombs.Margin = new Padding(3, 4, 3, 4);
checkBoxBombs.Name = "checkBoxBombs"; checkBoxBombs.Name = "checkBoxBombs";
checkBoxBombs.Size = new Size(196, 24); checkBoxBombs.Size = new Size(156, 19);
checkBoxBombs.TabIndex = 6; checkBoxBombs.TabIndex = 6;
checkBoxBombs.Text = "Признак наличия бомб"; checkBoxBombs.Text = "Признак наличия бомб";
checkBoxBombs.UseVisualStyleBackColor = true; checkBoxBombs.UseVisualStyleBackColor = true;
// //
// numericUpDownWeight // numericUpDownWeight
// //
numericUpDownWeight.Location = new Point(91, 109); numericUpDownWeight.Location = new Point(80, 82);
numericUpDownWeight.Margin = new Padding(3, 4, 3, 4);
numericUpDownWeight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 }); numericUpDownWeight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownWeight.Minimum = new decimal(new int[] { 100, 0, 0, 0 }); numericUpDownWeight.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownWeight.Name = "numericUpDownWeight"; numericUpDownWeight.Name = "numericUpDownWeight";
numericUpDownWeight.Size = new Size(101, 27); numericUpDownWeight.Size = new Size(88, 23);
numericUpDownWeight.TabIndex = 5; numericUpDownWeight.TabIndex = 5;
numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 }); numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 });
// //
// labelWeight // labelWeight
// //
labelWeight.AutoSize = true; labelWeight.AutoSize = true;
labelWeight.Location = new Point(14, 112); labelWeight.Location = new Point(12, 84);
labelWeight.Name = "labelWeight"; labelWeight.Name = "labelWeight";
labelWeight.Size = new Size(36, 20); labelWeight.Size = new Size(29, 15);
labelWeight.TabIndex = 4; labelWeight.TabIndex = 4;
labelWeight.Text = "Вес:"; labelWeight.Text = "Вес:";
// //
// numericUpDownSpeed // numericUpDownSpeed
// //
numericUpDownSpeed.Location = new Point(91, 51); numericUpDownSpeed.Location = new Point(80, 38);
numericUpDownSpeed.Margin = new Padding(3, 4, 3, 4);
numericUpDownSpeed.Maximum = new decimal(new int[] { 1000, 0, 0, 0 }); numericUpDownSpeed.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownSpeed.Minimum = new decimal(new int[] { 100, 0, 0, 0 }); numericUpDownSpeed.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownSpeed.Name = "numericUpDownSpeed"; numericUpDownSpeed.Name = "numericUpDownSpeed";
numericUpDownSpeed.Size = new Size(101, 27); numericUpDownSpeed.Size = new Size(88, 23);
numericUpDownSpeed.TabIndex = 3; numericUpDownSpeed.TabIndex = 3;
numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 }); numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 });
// //
// labelSpeed // labelSpeed
// //
labelSpeed.AutoSize = true; labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(14, 53); labelSpeed.Location = new Point(12, 40);
labelSpeed.Name = "labelSpeed"; labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(76, 20); labelSpeed.Size = new Size(62, 15);
labelSpeed.TabIndex = 2; labelSpeed.TabIndex = 2;
labelSpeed.Text = "Скорость:"; labelSpeed.Text = "Скорость:";
// //
// labelModifiedObject // labelModifiedObject
// //
labelModifiedObject.BorderStyle = BorderStyle.FixedSingle; labelModifiedObject.BorderStyle = BorderStyle.FixedSingle;
labelModifiedObject.Location = new Point(466, 222); labelModifiedObject.Location = new Point(408, 166);
labelModifiedObject.Name = "labelModifiedObject"; labelModifiedObject.Name = "labelModifiedObject";
labelModifiedObject.Size = new Size(117, 53); labelModifiedObject.Size = new Size(103, 40);
labelModifiedObject.TabIndex = 1; labelModifiedObject.TabIndex = 1;
labelModifiedObject.Text = "Продвинутый"; labelModifiedObject.Text = "Продвинутый";
labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter; labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter;
@@ -249,9 +233,9 @@
// labelSimpleObject // labelSimpleObject
// //
labelSimpleObject.BorderStyle = BorderStyle.FixedSingle; labelSimpleObject.BorderStyle = BorderStyle.FixedSingle;
labelSimpleObject.Location = new Point(330, 222); labelSimpleObject.Location = new Point(289, 166);
labelSimpleObject.Name = "labelSimpleObject"; labelSimpleObject.Name = "labelSimpleObject";
labelSimpleObject.Size = new Size(117, 53); labelSimpleObject.Size = new Size(103, 40);
labelSimpleObject.TabIndex = 0; labelSimpleObject.TabIndex = 0;
labelSimpleObject.Text = "Простой"; labelSimpleObject.Text = "Простой";
labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter; labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter;
@@ -259,19 +243,17 @@
// //
// pictureBoxObject // pictureBoxObject
// //
pictureBoxObject.Location = new Point(15, 69); pictureBoxObject.Location = new Point(13, 45);
pictureBoxObject.Margin = new Padding(3, 4, 3, 4);
pictureBoxObject.Name = "pictureBoxObject"; pictureBoxObject.Name = "pictureBoxObject";
pictureBoxObject.Size = new Size(194, 161); pictureBoxObject.Size = new Size(170, 136);
pictureBoxObject.TabIndex = 1; pictureBoxObject.TabIndex = 1;
pictureBoxObject.TabStop = false; pictureBoxObject.TabStop = false;
// //
// buttonAdd // buttonAdd
// //
buttonAdd.Location = new Point(672, 254); buttonAdd.Location = new Point(588, 190);
buttonAdd.Margin = new Padding(3, 4, 3, 4);
buttonAdd.Name = "buttonAdd"; buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(101, 53); buttonAdd.Size = new Size(88, 40);
buttonAdd.TabIndex = 2; buttonAdd.TabIndex = 2;
buttonAdd.Text = "Добавить"; buttonAdd.Text = "Добавить";
buttonAdd.UseVisualStyleBackColor = true; buttonAdd.UseVisualStyleBackColor = true;
@@ -279,10 +261,9 @@
// //
// buttonCancel // buttonCancel
// //
buttonCancel.Location = new Point(786, 254); buttonCancel.Location = new Point(688, 190);
buttonCancel.Margin = new Padding(3, 4, 3, 4);
buttonCancel.Name = "buttonCancel"; buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(102, 53); buttonCancel.Size = new Size(89, 40);
buttonCancel.TabIndex = 3; buttonCancel.TabIndex = 3;
buttonCancel.Text = "Отмена"; buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true; buttonCancel.UseVisualStyleBackColor = true;
@@ -293,10 +274,9 @@
panelObject.Controls.Add(labelBodyColor); panelObject.Controls.Add(labelBodyColor);
panelObject.Controls.Add(labelAdditionalColor); panelObject.Controls.Add(labelAdditionalColor);
panelObject.Controls.Add(pictureBoxObject); panelObject.Controls.Add(pictureBoxObject);
panelObject.Location = new Point(679, 0); panelObject.Location = new Point(594, 0);
panelObject.Margin = new Padding(3, 4, 3, 4);
panelObject.Name = "panelObject"; panelObject.Name = "panelObject";
panelObject.Size = new Size(222, 246); panelObject.Size = new Size(194, 184);
panelObject.TabIndex = 4; panelObject.TabIndex = 4;
panelObject.DragDrop += PanelObject_DragDrop; panelObject.DragDrop += PanelObject_DragDrop;
panelObject.DragEnter += PanelObject_DragEnter; panelObject.DragEnter += PanelObject_DragEnter;
@@ -305,9 +285,9 @@
// //
labelBodyColor.AllowDrop = true; labelBodyColor.AllowDrop = true;
labelBodyColor.BorderStyle = BorderStyle.FixedSingle; labelBodyColor.BorderStyle = BorderStyle.FixedSingle;
labelBodyColor.Location = new Point(15, 12); labelBodyColor.Location = new Point(13, 9);
labelBodyColor.Name = "labelBodyColor"; labelBodyColor.Name = "labelBodyColor";
labelBodyColor.Size = new Size(85, 43); labelBodyColor.Size = new Size(75, 33);
labelBodyColor.TabIndex = 2; labelBodyColor.TabIndex = 2;
labelBodyColor.Text = "Цвет"; labelBodyColor.Text = "Цвет";
labelBodyColor.TextAlign = ContentAlignment.MiddleCenter; labelBodyColor.TextAlign = ContentAlignment.MiddleCenter;
@@ -318,9 +298,9 @@
// //
labelAdditionalColor.AllowDrop = true; labelAdditionalColor.AllowDrop = true;
labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle; labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle;
labelAdditionalColor.Location = new Point(123, 12); labelAdditionalColor.Location = new Point(108, 9);
labelAdditionalColor.Name = "labelAdditionalColor"; labelAdditionalColor.Name = "labelAdditionalColor";
labelAdditionalColor.Size = new Size(85, 43); labelAdditionalColor.Size = new Size(75, 33);
labelAdditionalColor.TabIndex = 3; labelAdditionalColor.TabIndex = 3;
labelAdditionalColor.Text = "Доп. Цвет"; labelAdditionalColor.Text = "Доп. Цвет";
labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter; labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter;
@@ -329,14 +309,13 @@
// //
// FormAirPlaneConfig // FormAirPlaneConfig
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(909, 346); ClientSize = new Size(795, 260);
Controls.Add(panelObject); Controls.Add(panelObject);
Controls.Add(buttonCancel); Controls.Add(buttonCancel);
Controls.Add(buttonAdd); Controls.Add(buttonAdd);
Controls.Add(groupBoxConfig); Controls.Add(groupBoxConfig);
Margin = new Padding(3, 4, 3, 4);
Name = "FormAirPlaneConfig"; Name = "FormAirPlaneConfig";
Text = "Создание объекта"; Text = "Создание объекта";
groupBoxConfig.ResumeLayout(false); groupBoxConfig.ResumeLayout(false);

View File

@@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>