Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0498d0da74 | |||
| b822f2ef79 | |||
| a6ff38c3e4 | |||
| 8733297af1 |
70
ProjectCruiser/CollectionGenericObj/AbstractCompany.cs
Normal file
70
ProjectCruiser/CollectionGenericObj/AbstractCompany.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using ProjectCruiser.DrawningSamples;
|
||||
namespace ProjectCruiser.CollectionGenericObj;
|
||||
|
||||
/// Абстракция компании, хранящий коллекцию автомобилей
|
||||
/// </summary>
|
||||
public abstract class AbstractCompany
|
||||
{
|
||||
// Размеры места
|
||||
protected readonly int _placeSizeWidth = 312; // ширина
|
||||
|
||||
protected readonly int _placeSizeHeight = 56; // высота
|
||||
|
||||
// Ширина окна
|
||||
protected readonly int _pictureWidth;
|
||||
// Высота окна
|
||||
protected readonly int _pictureHeight;
|
||||
|
||||
// Коллекция автомобилей
|
||||
protected ICollectionGenObj<DrawningBase>? _collection = null;
|
||||
private int GetMaxCount => _pictureWidth * _pictureHeight /
|
||||
(_placeSizeWidth * _placeSizeHeight);
|
||||
|
||||
public AbstractCompany(int picWidth, int picHeight,
|
||||
ICollectionGenObj<DrawningBase>? collection)
|
||||
{
|
||||
_pictureWidth = picWidth;
|
||||
_pictureHeight = picHeight;
|
||||
_collection = collection;
|
||||
_collection.SetMaxCount = GetMaxCount;
|
||||
}
|
||||
|
||||
// Перегрузка оператора сложения для класса
|
||||
// [ ! ] insted of bool:
|
||||
public static int operator +(AbstractCompany company,
|
||||
DrawningBase trasport) => company._collection.Insert(trasport);
|
||||
|
||||
// Перегрузка оператора удаления для класса
|
||||
public static DrawningBase operator -(AbstractCompany company,
|
||||
int pos) => company._collection.Remove(pos);
|
||||
|
||||
// Получение случайного объекта из коллекции
|
||||
public DrawningBase? GetRandomObject()
|
||||
{
|
||||
Random rnd = new();
|
||||
return _collection?.GetItem(rnd.Next(GetMaxCount));
|
||||
}
|
||||
|
||||
// Вывод всей коллекции
|
||||
public Bitmap? Show()
|
||||
{
|
||||
Bitmap bitmap = new(_pictureWidth, _pictureHeight);
|
||||
Graphics graphics = Graphics.FromImage(bitmap);
|
||||
DrawBackground(graphics);
|
||||
SetObjectsPosition();
|
||||
for (int i = 0; i < (_collection?.Count ?? 0); ++i)
|
||||
{
|
||||
DrawningBase? obj = _collection?.GetItem(i);
|
||||
obj?.DrawTransport(graphics);
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
|
||||
// Вывод заднего фона
|
||||
protected abstract void DrawBackground(Graphics g);
|
||||
|
||||
// Расстановка объектов
|
||||
protected abstract void SetObjectsPosition();
|
||||
}
|
||||
|
||||
94
ProjectCruiser/CollectionGenericObj/ArrayGenObj.cs
Normal file
94
ProjectCruiser/CollectionGenericObj/ArrayGenObj.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
namespace ProjectCruiser.CollectionGenericObj;
|
||||
|
||||
public class ArrayGenObj<T> : ICollectionGenObj<T>
|
||||
where T : class
|
||||
{
|
||||
// Массив объектов, которые храним
|
||||
private T?[] _collection;
|
||||
public int Count => _collection.Length;
|
||||
public int SetMaxCount
|
||||
{
|
||||
set
|
||||
{
|
||||
if (value > 0)
|
||||
{
|
||||
if (_collection.Length > 0) Array.Resize(ref _collection, value);
|
||||
else _collection = new T?[value];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// public int SetMaxCount { set { if (value > 0) { _collection = new T?[value]; } } }
|
||||
|
||||
public ArrayGenObj()
|
||||
{
|
||||
_collection = Array.Empty<T?>();
|
||||
}
|
||||
|
||||
// methods :
|
||||
|
||||
public T? GetItem(int index)
|
||||
{
|
||||
if (index > Count || index < 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return _collection[index];
|
||||
}
|
||||
|
||||
public int Insert(T? item)
|
||||
{
|
||||
// any empty place
|
||||
for (int i = 0; i < Count; i++)
|
||||
{
|
||||
if (_collection[i] == null)
|
||||
{
|
||||
_collection[i] = item;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int Insert(T? item, int index)
|
||||
{
|
||||
if (_collection[index] == null)
|
||||
{
|
||||
_collection[index] = item;
|
||||
return index;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
int min_diff = 100, min_index = 100;
|
||||
|
||||
for (int i = 0; i < Count; i++)
|
||||
{
|
||||
if (_collection[i] == null
|
||||
&& min_diff > Math.Abs(index - i))
|
||||
{
|
||||
min_diff = Math.Abs(index - i);
|
||||
min_index = i;
|
||||
}
|
||||
}
|
||||
|
||||
_collection[min_index] = item;
|
||||
return min_index;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public T? Remove(int index)
|
||||
{
|
||||
T? item;
|
||||
if (index < Count && index >= 0)
|
||||
{
|
||||
item = _collection[index];
|
||||
_collection[index] = null;
|
||||
return item;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
8
ProjectCruiser/CollectionGenericObj/CollectionType.cs
Normal file
8
ProjectCruiser/CollectionGenericObj/CollectionType.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace ProjectCruiser.CollectionGenericObj;
|
||||
|
||||
public enum CollectionType
|
||||
{
|
||||
None = 0,
|
||||
Array = 1,
|
||||
List = 2
|
||||
}
|
||||
24
ProjectCruiser/CollectionGenericObj/ICollectionGenObj.cs
Normal file
24
ProjectCruiser/CollectionGenericObj/ICollectionGenObj.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace ProjectCruiser.CollectionGenericObj;
|
||||
|
||||
public interface ICollectionGenObj<T> where T : class
|
||||
{
|
||||
// Кол-во объектов в коллекции
|
||||
int Count { get; }
|
||||
|
||||
// Установка max кол-ва элементов
|
||||
int SetMaxCount { set; }
|
||||
|
||||
/// Добавление объекта в коллекцию
|
||||
/// <param name="obj">Добавляемый объект</param>
|
||||
/// <returns>true - вставка прошла удачно, false - вставка не удалась</returns>
|
||||
int Insert(T obj);
|
||||
int Insert(T obj, int position);
|
||||
|
||||
/// Удаление объекта из коллекции с конкретной позиции
|
||||
/// <param name="position">Позиция</param>
|
||||
/// <returns>true - удаление прошло удачно, false - удаление не удалось</returns>
|
||||
T? Remove(int position);
|
||||
|
||||
// Получение объекта по позиции
|
||||
T? GetItem(int position);
|
||||
}
|
||||
70
ProjectCruiser/CollectionGenericObj/ListGenObj.cs
Normal file
70
ProjectCruiser/CollectionGenericObj/ListGenObj.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ProjectCruiser.CollectionGenericObj;
|
||||
|
||||
// Параметризованный набор объектов
|
||||
public class ListGenObj<T> : ICollectionGenObj<T>
|
||||
where T : class
|
||||
{
|
||||
// Список объектов, которые храним
|
||||
private readonly List<T?> _collection;
|
||||
|
||||
// Максимально допустимое число объектов в списке
|
||||
private int _maxCount;
|
||||
public int Count => _collection.Count;
|
||||
|
||||
public int SetMaxCount { set { if (value > 0) { _maxCount = value; } } }
|
||||
|
||||
public ListGenObj()
|
||||
{
|
||||
_collection = new();
|
||||
}
|
||||
|
||||
public T? GetItem(int position)
|
||||
{
|
||||
if (position >= Count || position < 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return _collection[position];
|
||||
}
|
||||
|
||||
public int Insert(T obj)
|
||||
{
|
||||
if (Count >= _maxCount || obj == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
_collection.Add(obj);
|
||||
return Count;
|
||||
}
|
||||
|
||||
public int Insert(T obj, int position)
|
||||
{
|
||||
if (position >= _maxCount || Count >= _maxCount ||
|
||||
position < 0 || _collection[position] != null
|
||||
|| obj == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
_collection.Insert(position, obj);
|
||||
return position;
|
||||
}
|
||||
|
||||
public T? Remove(int position)
|
||||
{
|
||||
if (position >= Count || position < 0)
|
||||
// on the other positions items don't exist
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
T? item = _collection[position];
|
||||
_collection.RemoveAt(position);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
69
ProjectCruiser/CollectionGenericObj/ShipSharingService.cs
Normal file
69
ProjectCruiser/CollectionGenericObj/ShipSharingService.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using ProjectCruiser.DrawningSamples;
|
||||
namespace ProjectCruiser.CollectionGenericObj;
|
||||
|
||||
public class ShipSharingService : AbstractCompany
|
||||
{
|
||||
protected int MaxInRow { get; private set; }
|
||||
protected int MaxInColon { get; private set; }
|
||||
|
||||
private int fromBorder = 20, fromCeiling = 20, between = 30;
|
||||
|
||||
public ShipSharingService(int picWidth, int picHeight,
|
||||
ICollectionGenObj<DrawningBase> collection)
|
||||
: base(picWidth, picHeight, collection)
|
||||
{
|
||||
MaxInRow = (picWidth - fromBorder - fromCeiling)
|
||||
/ (_placeSizeWidth + between);
|
||||
MaxInColon = (picHeight - fromBorder - fromCeiling)
|
||||
/ _placeSizeHeight;
|
||||
}
|
||||
|
||||
protected override void DrawBackground(Graphics g)
|
||||
{
|
||||
Pen pen = new(Color.Black, 2);
|
||||
|
||||
int currentH = fromCeiling, currentW = fromBorder;
|
||||
|
||||
for (int i = 0; i < MaxInRow; i++)
|
||||
{
|
||||
currentH = fromCeiling;
|
||||
for (int j = 0; j < MaxInColon; j++)
|
||||
{
|
||||
g.DrawLine(pen, currentW + _placeSizeWidth,
|
||||
currentH, currentW, currentH);
|
||||
|
||||
g.DrawLine(pen, currentW, currentH,
|
||||
currentW, currentH + _placeSizeHeight);
|
||||
|
||||
currentH += _placeSizeHeight + 1;
|
||||
}
|
||||
currentW += _placeSizeWidth + between;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetObjectsPosition()
|
||||
{
|
||||
int index_collection = 0;
|
||||
int newX = fromBorder + 6, newY = fromCeiling + 6;
|
||||
|
||||
if (_collection != null)
|
||||
{
|
||||
for (int i = 0; i < MaxInColon; ++i)
|
||||
{
|
||||
newX = fromBorder + 2;
|
||||
for (int j = 0; j < MaxInRow; ++j)
|
||||
{
|
||||
if (_collection.GetItem(index_collection) != null)
|
||||
{
|
||||
_collection.GetItem(index_collection).SetPictureSize(_pictureWidth, _pictureHeight);
|
||||
_collection.GetItem(index_collection).SetPosition(newX, newY);
|
||||
newX += _placeSizeWidth + between + 2;
|
||||
index_collection++;
|
||||
}
|
||||
}
|
||||
newY += _placeSizeHeight + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
57
ProjectCruiser/CollectionGenericObj/StorageCollection.cs
Normal file
57
ProjectCruiser/CollectionGenericObj/StorageCollection.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
namespace ProjectCruiser.CollectionGenericObj;
|
||||
|
||||
public class StorageCollection<T>
|
||||
where T : class
|
||||
{
|
||||
// Словарь (хранилище) с коллекциями < name, type (class) >
|
||||
readonly Dictionary<string, ICollectionGenObj<T>> _storages;
|
||||
|
||||
// Возвращение списка названий коллекций
|
||||
public List<string> Keys => _storages.Keys.ToList();
|
||||
|
||||
public StorageCollection()
|
||||
{
|
||||
_storages = new Dictionary<string, ICollectionGenObj<T>>();
|
||||
}
|
||||
|
||||
/// Добавление коллекции в хранилище
|
||||
/// <param name="name">Название коллекции</param>
|
||||
/// <param name="collectionType">тип коллекции</param>
|
||||
public void AddCollection(string name, CollectionType collType)
|
||||
{
|
||||
if (name == null || _storages.ContainsKey(name)
|
||||
|| collType == CollectionType.None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (collType)
|
||||
{
|
||||
case CollectionType.List: _storages.Add(name, new ListGenObj<T>()); break;
|
||||
// _storages[name] = new ListGenericObjects<T>(); break; [*]
|
||||
|
||||
case CollectionType.Array: _storages.Add(name, new ArrayGenObj<T>()); break;
|
||||
}
|
||||
}
|
||||
|
||||
/// Удаление коллекции ( по ключу-строке - её имени )
|
||||
/// <param name="name">Название коллекции</param>
|
||||
public void DelCollection(string name)
|
||||
{
|
||||
if (_storages.ContainsKey(name)) _storages.Remove(name);
|
||||
return;
|
||||
}
|
||||
|
||||
/// Доступ к коллекции ( по ключу-строке - её имени )
|
||||
public ICollectionGenObj<T>? this[string name]
|
||||
{
|
||||
get => _storages.ContainsKey(name) ? _storages[name] : null;
|
||||
/* ^^^
|
||||
{
|
||||
if (_storages.ContainsKey(name)) return _storages[name];
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ public class DrawningCruiser : DrawningBase
|
||||
{
|
||||
// Инициализация свойств (все параметры класса (сущности))
|
||||
public DrawningCruiser(int speed, double weight, Color bodyColor,
|
||||
Color additionalColor, bool pads, bool hangar) : base(302, 42)
|
||||
Color additionalColor, bool hangars) : base(302, 42)
|
||||
// all additional featchures 'inside' object, so size remains
|
||||
{
|
||||
EntityTransport = new EntityCruiser(speed, weight,
|
||||
bodyColor, additionalColor, pads, hangar);
|
||||
bodyColor, additionalColor, hangars);
|
||||
}
|
||||
|
||||
public override void DrawTransport(Graphics g)
|
||||
@@ -31,24 +31,16 @@ public class DrawningCruiser : DrawningBase
|
||||
|
||||
base.DrawTransport(g);
|
||||
|
||||
// вертолетная площадка
|
||||
if (ship.HelicopterPads)
|
||||
{
|
||||
g.DrawEllipse(pen, _startPosX.Value + 170, _startPosY.Value + 11, 20, 20);
|
||||
g.FillEllipse(PadBrush, _startPosX.Value + 170, _startPosY.Value + 11, 20, 20);
|
||||
}
|
||||
// вертолетная площадка - default TRUE now
|
||||
g.DrawEllipse(pen, _startPosX.Value + 170, _startPosY.Value + 11, 20, 20);
|
||||
g.FillEllipse(PadBrush, _startPosX.Value + 170, _startPosY.Value + 11, 20, 20);
|
||||
|
||||
// ангар
|
||||
if (ship.Hangar)
|
||||
// ангар(ы)
|
||||
if (ship.Hangars)
|
||||
{
|
||||
int n = EntityTransport.values[2];
|
||||
if (n == 1) g.FillRectangle(additionalBrush, _startPosX.Value + 250, _startPosY.Value + 20, 14, 7);
|
||||
|
||||
else
|
||||
{
|
||||
g.FillRectangle(additionalBrush, _startPosX.Value + 80, _startPosY.Value + 10, 10, 20);
|
||||
g.FillRectangle(additionalBrush, _startPosX.Value + 70, _startPosY.Value + 12, 8, 12);
|
||||
}
|
||||
g.FillRectangle(additionalBrush, _startPosX.Value + 80, _startPosY.Value + 10, 10, 20);
|
||||
g.FillRectangle(additionalBrush, _startPosX.Value + 70, _startPosY.Value + 12, 8, 12);
|
||||
}
|
||||
else g.FillRectangle(additionalBrush, _startPosX.Value + 250, _startPosY.Value + 20, 14, 7);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@ public class EntityCruiser : EntityBase
|
||||
|
||||
// признаки (наличия)
|
||||
public bool HelicopterPads { get; private set; } // вертолетная площадка
|
||||
public bool Hangar { get; private set; } // ангар
|
||||
public bool Hangars { get; private set; } // ангар
|
||||
|
||||
public EntityCruiser(int speed, double weight, Color mainc,
|
||||
Color additionalColor, bool pads, bool hangar)
|
||||
Color additionalColor, bool hangars)
|
||||
: base(speed, weight, mainc)
|
||||
{
|
||||
AdditionalColor = additionalColor;
|
||||
HelicopterPads = pads;
|
||||
Hangar = hangar;
|
||||
// HelicopterPads = pads; - default TRUE now for Advanced obj
|
||||
Hangars = hangars;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectCruiser.MoveStrategy;
|
||||
namespace ProjectCruiser.MoveStrategy;
|
||||
|
||||
public class MoveToBorder : AbstractStrategy
|
||||
{
|
||||
|
||||
@@ -11,6 +11,19 @@ namespace ProjectCruiser
|
||||
// Стратегия перемещения
|
||||
private AbstractStrategy? _strategy;
|
||||
|
||||
// Получение объекта
|
||||
public DrawningBase SetShip
|
||||
{
|
||||
set
|
||||
{
|
||||
_drawningCruiser = value;
|
||||
_drawningCruiser.SetPictureSize(pictureBoxCr.Width, pictureBoxCr.Height);
|
||||
comboBoxStrategy.Enabled = true;
|
||||
_strategy = null;
|
||||
Draw();
|
||||
}
|
||||
}
|
||||
|
||||
public OceanForm1()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -51,10 +64,11 @@ namespace ProjectCruiser
|
||||
break;
|
||||
|
||||
case nameof(DrawningCruiser):
|
||||
_drawningCruiser = new DrawningCruiser(random.Next(100, 300), random.Next(1000, 3000),
|
||||
_drawningCruiser = new DrawningCruiser(
|
||||
random.Next(100, 300), random.Next(1000, 3000),
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
||||
Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)));
|
||||
Convert.ToBoolean(random.Next(0, 2)));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -11,7 +11,8 @@ namespace ProjectCruiser
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new OceanForm1());
|
||||
Application.Run(new ServiceForm2());
|
||||
// -> OceanForm1() inside*
|
||||
}
|
||||
}
|
||||
}
|
||||
303
ProjectCruiser/ServiceForm2.Designer.cs
generated
Normal file
303
ProjectCruiser/ServiceForm2.Designer.cs
generated
Normal file
@@ -0,0 +1,303 @@
|
||||
namespace ProjectCruiser
|
||||
{
|
||||
partial class ServiceForm2
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
comboBoxArrList = new ComboBox();
|
||||
btnAddBase = new Button();
|
||||
groupBox = new GroupBox();
|
||||
toolPanel = new Panel();
|
||||
btnUpdate = new Button();
|
||||
btnTest = new Button();
|
||||
maskedTextBoxPosition = new MaskedTextBox();
|
||||
btnDelete = new Button();
|
||||
btnAddCruiser = new Button();
|
||||
btnCreateCompany = new Button();
|
||||
pictureBox = new PictureBox();
|
||||
companyPanel = new Panel();
|
||||
btnDeleteCollection = new Button();
|
||||
listBox = new ListBox();
|
||||
btnAddCollection = new Button();
|
||||
rBtnList = new RadioButton();
|
||||
rBtnArray = new RadioButton();
|
||||
maskedTxtBoxCName = new MaskedTextBox();
|
||||
label = new Label();
|
||||
groupBox.SuspendLayout();
|
||||
toolPanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pictureBox).BeginInit();
|
||||
companyPanel.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// comboBoxArrList
|
||||
//
|
||||
comboBoxArrList.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
comboBoxArrList.FormattingEnabled = true;
|
||||
comboBoxArrList.Items.AddRange(new object[] { "Storage" });
|
||||
comboBoxArrList.Location = new Point(17, 41);
|
||||
comboBoxArrList.Name = "comboBoxArrList";
|
||||
comboBoxArrList.Size = new Size(241, 40);
|
||||
comboBoxArrList.TabIndex = 0;
|
||||
comboBoxArrList.SelectedIndexChanged += SelectorCompany_SelectedIndexChanged;
|
||||
//
|
||||
// btnAddBase
|
||||
//
|
||||
btnAddBase.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
btnAddBase.Location = new Point(17, 13);
|
||||
btnAddBase.Name = "btnAddBase";
|
||||
btnAddBase.Size = new Size(192, 43);
|
||||
btnAddBase.TabIndex = 1;
|
||||
btnAddBase.Text = "Add ship";
|
||||
btnAddBase.UseVisualStyleBackColor = true;
|
||||
btnAddBase.Click += btnAddBase_Click;
|
||||
//
|
||||
// groupBox
|
||||
//
|
||||
groupBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
groupBox.Controls.Add(companyPanel);
|
||||
groupBox.Controls.Add(toolPanel);
|
||||
groupBox.Controls.Add(btnCreateCompany);
|
||||
groupBox.Controls.Add(comboBoxArrList);
|
||||
groupBox.Location = new Point(1421, 10);
|
||||
groupBox.Name = "groupBox";
|
||||
groupBox.Size = new Size(273, 986);
|
||||
groupBox.TabIndex = 2;
|
||||
groupBox.TabStop = false;
|
||||
groupBox.Text = "Tool panel";
|
||||
//
|
||||
// toolPanel
|
||||
//
|
||||
toolPanel.Controls.Add(btnUpdate);
|
||||
toolPanel.Controls.Add(btnTest);
|
||||
toolPanel.Controls.Add(maskedTextBoxPosition);
|
||||
toolPanel.Controls.Add(btnDelete);
|
||||
toolPanel.Controls.Add(btnAddCruiser);
|
||||
toolPanel.Controls.Add(btnAddBase);
|
||||
toolPanel.Enabled = false;
|
||||
toolPanel.Location = new Point(26, 593);
|
||||
toolPanel.Name = "toolPanel";
|
||||
toolPanel.Size = new Size(226, 377);
|
||||
toolPanel.TabIndex = 13;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
btnUpdate.Location = new Point(17, 315);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(192, 49);
|
||||
btnUpdate.TabIndex = 6;
|
||||
btnUpdate.Text = "Update";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnRefresh_Click;
|
||||
//
|
||||
// btnTest
|
||||
//
|
||||
btnTest.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
btnTest.Location = new Point(17, 224);
|
||||
btnTest.Name = "btnTest";
|
||||
btnTest.Size = new Size(192, 85);
|
||||
btnTest.TabIndex = 5;
|
||||
btnTest.Text = "Choose\r\nfor testing";
|
||||
btnTest.UseVisualStyleBackColor = true;
|
||||
btnTest.Click += btnChooseforTest_Click;
|
||||
//
|
||||
// maskedTextBoxPosition
|
||||
//
|
||||
maskedTextBoxPosition.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
maskedTextBoxPosition.Location = new Point(17, 119);
|
||||
maskedTextBoxPosition.Mask = "00";
|
||||
maskedTextBoxPosition.Name = "maskedTextBoxPosition";
|
||||
maskedTextBoxPosition.Size = new Size(192, 39);
|
||||
maskedTextBoxPosition.TabIndex = 3;
|
||||
maskedTextBoxPosition.ValidatingType = typeof(int);
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
btnDelete.Location = new Point(17, 170);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(192, 48);
|
||||
btnDelete.TabIndex = 4;
|
||||
btnDelete.Text = "Delete";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnRemoveCar_Click;
|
||||
//
|
||||
// btnAddCruiser
|
||||
//
|
||||
btnAddCruiser.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
btnAddCruiser.Location = new Point(17, 62);
|
||||
btnAddCruiser.Name = "btnAddCruiser";
|
||||
btnAddCruiser.Size = new Size(192, 51);
|
||||
btnAddCruiser.TabIndex = 2;
|
||||
btnAddCruiser.Text = "Add cruiser";
|
||||
btnAddCruiser.UseVisualStyleBackColor = true;
|
||||
btnAddCruiser.Click += btnAddAdvanced_Click;
|
||||
//
|
||||
// btnCreateCompany
|
||||
//
|
||||
btnCreateCompany.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
btnCreateCompany.Location = new Point(17, 526);
|
||||
btnCreateCompany.Name = "btnCreateCompany";
|
||||
btnCreateCompany.Size = new Size(243, 61);
|
||||
btnCreateCompany.TabIndex = 12;
|
||||
btnCreateCompany.Text = "Create Company";
|
||||
btnCreateCompany.UseVisualStyleBackColor = true;
|
||||
btnCreateCompany.Click += btnCreateCompany_Click;
|
||||
//
|
||||
// pictureBox
|
||||
//
|
||||
pictureBox.Dock = DockStyle.Left;
|
||||
pictureBox.Location = new Point(0, 0);
|
||||
pictureBox.Name = "pictureBox";
|
||||
pictureBox.Size = new Size(1415, 1007);
|
||||
pictureBox.TabIndex = 3;
|
||||
pictureBox.TabStop = false;
|
||||
//
|
||||
// companyPanel
|
||||
//
|
||||
companyPanel.Controls.Add(btnDeleteCollection);
|
||||
companyPanel.Controls.Add(listBox);
|
||||
companyPanel.Controls.Add(btnAddCollection);
|
||||
companyPanel.Controls.Add(rBtnList);
|
||||
companyPanel.Controls.Add(rBtnArray);
|
||||
companyPanel.Controls.Add(maskedTxtBoxCName);
|
||||
companyPanel.Controls.Add(label);
|
||||
companyPanel.Location = new Point(17, 91);
|
||||
companyPanel.Name = "companyPanel";
|
||||
companyPanel.Size = new Size(243, 429);
|
||||
companyPanel.TabIndex = 7;
|
||||
//
|
||||
// btnDeleteCollection
|
||||
//
|
||||
btnDeleteCollection.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
btnDeleteCollection.Location = new Point(15, 371);
|
||||
btnDeleteCollection.Name = "btnDeleteCollection";
|
||||
btnDeleteCollection.Size = new Size(214, 43);
|
||||
btnDeleteCollection.TabIndex = 11;
|
||||
btnDeleteCollection.Text = "Remove Collection";
|
||||
btnDeleteCollection.UseVisualStyleBackColor = true;
|
||||
btnDeleteCollection.Click += btnCollectionDel_Click;
|
||||
//
|
||||
// listBox
|
||||
//
|
||||
listBox.FormattingEnabled = true;
|
||||
listBox.Location = new Point(16, 199);
|
||||
listBox.Name = "listBox";
|
||||
listBox.Size = new Size(214, 164);
|
||||
listBox.TabIndex = 10;
|
||||
//
|
||||
// btnAddCollection
|
||||
//
|
||||
btnAddCollection.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
btnAddCollection.Location = new Point(15, 130);
|
||||
btnAddCollection.Name = "btnAddCollection";
|
||||
btnAddCollection.Size = new Size(214, 61);
|
||||
btnAddCollection.TabIndex = 7;
|
||||
btnAddCollection.Text = "Add Collection";
|
||||
btnAddCollection.UseVisualStyleBackColor = true;
|
||||
btnAddCollection.Click += btnCollectionAdd_Click;
|
||||
//
|
||||
// rBtnList
|
||||
//
|
||||
rBtnList.AutoSize = true;
|
||||
rBtnList.Location = new Point(150, 88);
|
||||
rBtnList.Name = "rBtnList";
|
||||
rBtnList.Size = new Size(80, 36);
|
||||
rBtnList.TabIndex = 9;
|
||||
rBtnList.TabStop = true;
|
||||
rBtnList.Text = "List";
|
||||
rBtnList.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// rBtnArray
|
||||
//
|
||||
rBtnArray.AutoSize = true;
|
||||
rBtnArray.Location = new Point(16, 88);
|
||||
rBtnArray.Name = "rBtnArray";
|
||||
rBtnArray.Size = new Size(100, 36);
|
||||
rBtnArray.TabIndex = 8;
|
||||
rBtnArray.TabStop = true;
|
||||
rBtnArray.Text = "Array";
|
||||
rBtnArray.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// maskedTxtBoxCName
|
||||
//
|
||||
maskedTxtBoxCName.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
maskedTxtBoxCName.Location = new Point(16, 43);
|
||||
maskedTxtBoxCName.Name = "maskedTxtBoxCName";
|
||||
maskedTxtBoxCName.Size = new Size(214, 39);
|
||||
maskedTxtBoxCName.TabIndex = 7;
|
||||
//
|
||||
// label
|
||||
//
|
||||
label.AutoSize = true;
|
||||
label.Location = new Point(29, 6);
|
||||
label.Name = "label";
|
||||
label.Size = new Size(188, 32);
|
||||
label.TabIndex = 0;
|
||||
label.Text = "Collection name";
|
||||
//
|
||||
// ServiceForm2
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(13F, 32F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1700, 1007);
|
||||
Controls.Add(pictureBox);
|
||||
Controls.Add(groupBox);
|
||||
Name = "ServiceForm2";
|
||||
Text = "ServiceForm2";
|
||||
groupBox.ResumeLayout(false);
|
||||
toolPanel.ResumeLayout(false);
|
||||
toolPanel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pictureBox).EndInit();
|
||||
companyPanel.ResumeLayout(false);
|
||||
companyPanel.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComboBox comboBoxArrList;
|
||||
private Button btnAddBase;
|
||||
private GroupBox groupBox;
|
||||
private Button btnAddCruiser;
|
||||
private Button btnUpdate;
|
||||
private Button btnTest;
|
||||
private Button btnDelete;
|
||||
private MaskedTextBox maskedTextBoxPosition;
|
||||
private PictureBox pictureBox;
|
||||
private Panel companyPanel;
|
||||
private RadioButton rBtnArray;
|
||||
private MaskedTextBox maskedTxtBoxCName;
|
||||
private Label label;
|
||||
private RadioButton rBtnList;
|
||||
private Button btnAddCollection;
|
||||
private ListBox listBox;
|
||||
private Button btnDeleteCollection;
|
||||
private Button btnCreateCompany;
|
||||
private Panel toolPanel;
|
||||
}
|
||||
}
|
||||
228
ProjectCruiser/ServiceForm2.cs
Normal file
228
ProjectCruiser/ServiceForm2.cs
Normal file
@@ -0,0 +1,228 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
using ProjectCruiser.CollectionGenericObj;
|
||||
using ProjectCruiser.DrawningSamples;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
namespace ProjectCruiser;
|
||||
|
||||
public partial class ServiceForm2 : Form
|
||||
{
|
||||
// Компания
|
||||
private AbstractCompany? _company = null;
|
||||
|
||||
private readonly StorageCollection<DrawningBase> _storageCollection;
|
||||
|
||||
public ServiceForm2()
|
||||
{
|
||||
InitializeComponent();
|
||||
_storageCollection = new();
|
||||
}
|
||||
|
||||
// Выбор компании
|
||||
private void SelectorCompany_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
/*
|
||||
switch (comboBoxArrList.Text)
|
||||
{
|
||||
case "Storage":
|
||||
_company = new ShipSharingService(pictureBox.Width, pictureBox.Height,
|
||||
new ArrayGenObj<DrawningBase>());
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
toolPanel.Enabled = false;
|
||||
}
|
||||
|
||||
// Color picker (default : random)
|
||||
private static Color pickColor(Random r)
|
||||
{
|
||||
Color cl = new Color();
|
||||
ColorDialog dialog = new();
|
||||
|
||||
if (dialog.ShowDialog() == DialogResult.OK) cl = dialog.Color;
|
||||
else Color.FromArgb(r.Next(0, 256), r.Next(0, 256), r.Next(0, 256));
|
||||
|
||||
return cl;
|
||||
}
|
||||
|
||||
// Добавление обычного корабля
|
||||
private void btnAddBase_Click(object sender, EventArgs e) =>
|
||||
CreateObject(nameof(DrawningBase));
|
||||
|
||||
// Добавление продвинутого
|
||||
private void btnAddAdvanced_Click(object sender, EventArgs e) =>
|
||||
CreateObject(nameof(DrawningCruiser));
|
||||
|
||||
// Создание объекта класса-перемещения
|
||||
private void CreateObject(string type)
|
||||
{
|
||||
if (_company == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Random random = new();
|
||||
DrawningBase drawningCar;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case nameof(DrawningBase):
|
||||
drawningCar = new DrawningBase(random.Next(100, 300),
|
||||
random.Next(1000, 3000), pickColor(random));
|
||||
break;
|
||||
|
||||
case nameof(DrawningCruiser):
|
||||
drawningCar = new DrawningCruiser(random.Next(100, 300),
|
||||
random.Next(1000, 3000), pickColor(random), pickColor(random),
|
||||
Convert.ToBoolean(random.Next(0, 2)));
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if (_company + drawningCar != -1)
|
||||
{
|
||||
MessageBox.Show("> Object was added");
|
||||
pictureBox.Image = _company.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("[!] Failed to add object");
|
||||
}
|
||||
}
|
||||
|
||||
// Удаление объекта
|
||||
private void btnRemoveCar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(maskedTextBoxPosition.Text)
|
||||
|| _company == null) return;
|
||||
|
||||
if (MessageBox.Show("[*] Remove object: Are you sure?", "Remove",
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return;
|
||||
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
|
||||
|
||||
if (_company - Convert.ToInt32(maskedTextBoxPosition.Text) != null)
|
||||
{
|
||||
MessageBox.Show("> Object was removed");
|
||||
pictureBox.Image = _company.Show();
|
||||
}
|
||||
else MessageBox.Show("[!] Failed to remove object");
|
||||
}
|
||||
|
||||
// Передача объекта в другую форму
|
||||
private void btnChooseforTest_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_company == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
DrawningBase? car = null;
|
||||
int counter = 100;
|
||||
while (car == null)
|
||||
{
|
||||
car = _company.GetRandomObject();
|
||||
counter--;
|
||||
if (counter <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (car == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
OceanForm1 form = new() { SetShip = car };
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
// Перерисовка коллекции
|
||||
private void btnRefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_company == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
pictureBox.Image = _company.Show();
|
||||
}
|
||||
|
||||
private void btnCollectionAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(maskedTxtBoxCName.Text) || (!rBtnList.Checked && !rBtnArray.Checked))
|
||||
{
|
||||
MessageBox.Show("Enter correct data or choose an option", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
CollectionType collType = CollectionType.None;
|
||||
|
||||
if (rBtnArray.Checked)
|
||||
{
|
||||
collType = CollectionType.Array;
|
||||
}
|
||||
else if (rBtnList.Checked)
|
||||
{
|
||||
collType = CollectionType.List;
|
||||
}
|
||||
|
||||
_storageCollection.AddCollection(maskedTxtBoxCName.Text, collType);
|
||||
RefreshListBoxItems();
|
||||
}
|
||||
|
||||
private void btnCollectionDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listBox.SelectedItem == null || listBox.SelectedIndex < 0)
|
||||
{
|
||||
MessageBox.Show("Collection was not choosed");
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Are you sure?", "Removing", MessageBoxButtons.OK, MessageBoxIcon.Question) != DialogResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_storageCollection.DelCollection(listBox.SelectedItem.ToString());
|
||||
RefreshListBoxItems();
|
||||
}
|
||||
|
||||
private void RefreshListBoxItems()
|
||||
{
|
||||
listBox.Items.Clear();
|
||||
for (int i = 0; i < _storageCollection.Keys?.Count; ++i)
|
||||
{
|
||||
string? collName = _storageCollection.Keys?[i];
|
||||
if (!string.IsNullOrEmpty(collName))
|
||||
{
|
||||
listBox.Items.Add(collName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCreateCompany_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listBox.SelectedIndex < 0 || listBox.SelectedItem == null)
|
||||
{
|
||||
MessageBox.Show("Collection wasn't choosed");
|
||||
return;
|
||||
}
|
||||
|
||||
ICollectionGenObj<DrawningBase>? collection =
|
||||
_storageCollection[listBox.SelectedItem.ToString() ?? string.Empty];
|
||||
|
||||
if (collection == null)
|
||||
{
|
||||
MessageBox.Show("Collection wasn't initialized");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (comboBoxArrList.Text)
|
||||
{
|
||||
case "Storage":
|
||||
_company = new ShipSharingService(pictureBox.Width,
|
||||
pictureBox.Height, collection);
|
||||
break;
|
||||
}
|
||||
|
||||
toolPanel.Enabled = true; // block of buttons at the right bottom
|
||||
RefreshListBoxItems();
|
||||
}
|
||||
}
|
||||
120
ProjectCruiser/ServiceForm2.resx
Normal file
120
ProjectCruiser/ServiceForm2.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user