Almost ready lab 6, but weight of Electro Loco always 354... why?
This commit is contained in:
parent
e3b1101da1
commit
a2cc6dcd8d
@ -28,229 +28,224 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
components = new System.ComponentModel.Container();
|
||||||
this.maskedTextBoxNumber = new System.Windows.Forms.MaskedTextBox();
|
maskedTextBoxNumber = new MaskedTextBox();
|
||||||
this.ButtonRefreshCollection = new System.Windows.Forms.Button();
|
ButtonRefreshCollection = new Button();
|
||||||
this.ButtonRemoveLocomotive = new System.Windows.Forms.Button();
|
ButtonRemoveLocomotive = new Button();
|
||||||
this.ButtonAddLocomotive = new System.Windows.Forms.Button();
|
ButtonAddLocomotive = new Button();
|
||||||
this.pictureBoxCollections = new System.Windows.Forms.PictureBox();
|
pictureBoxCollections = new PictureBox();
|
||||||
this.textBoxStorageName = new System.Windows.Forms.TextBox();
|
textBoxStorageName = new TextBox();
|
||||||
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
|
bindingSource1 = new BindingSource(components);
|
||||||
this.bindingSource2 = new System.Windows.Forms.BindingSource(this.components);
|
bindingSource2 = new BindingSource(components);
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
groupBox1 = new GroupBox();
|
||||||
this.listBoxStorage = new System.Windows.Forms.ListBox();
|
listBoxStorage = new ListBox();
|
||||||
this.ButtonAddObject = new System.Windows.Forms.Button();
|
ButtonAddObject = new Button();
|
||||||
this.ButtonRemoveObject = new System.Windows.Forms.Button();
|
ButtonRemoveObject = new Button();
|
||||||
this.Instruments = new System.Windows.Forms.GroupBox();
|
Instruments = new GroupBox();
|
||||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
menuStrip1 = new MenuStrip();
|
||||||
this.файлToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
файлToolStripMenuItem = new ToolStripMenuItem();
|
||||||
this.SaveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
SaveToolStripMenuItem = new ToolStripMenuItem();
|
||||||
this.LoadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
LoadToolStripMenuItem = new ToolStripMenuItem();
|
||||||
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
saveFileDialog = new SaveFileDialog();
|
||||||
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
|
openFileDialog = new OpenFileDialog();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCollections)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureBoxCollections).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)bindingSource1).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.bindingSource2)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)bindingSource2).BeginInit();
|
||||||
this.groupBox1.SuspendLayout();
|
groupBox1.SuspendLayout();
|
||||||
this.Instruments.SuspendLayout();
|
Instruments.SuspendLayout();
|
||||||
this.menuStrip1.SuspendLayout();
|
menuStrip1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// maskedTextBoxNumber
|
// maskedTextBoxNumber
|
||||||
//
|
//
|
||||||
this.maskedTextBoxNumber.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
maskedTextBoxNumber.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
maskedTextBoxNumber.Location = new Point(38, 532);
|
||||||
this.maskedTextBoxNumber.Location = new System.Drawing.Point(38, 532);
|
maskedTextBoxNumber.Mask = "0";
|
||||||
this.maskedTextBoxNumber.Mask = "0";
|
maskedTextBoxNumber.Name = "maskedTextBoxNumber";
|
||||||
this.maskedTextBoxNumber.Name = "maskedTextBoxNumber";
|
maskedTextBoxNumber.Size = new Size(156, 27);
|
||||||
this.maskedTextBoxNumber.Size = new System.Drawing.Size(156, 27);
|
maskedTextBoxNumber.TabIndex = 4;
|
||||||
this.maskedTextBoxNumber.TabIndex = 4;
|
|
||||||
//
|
//
|
||||||
// ButtonRefreshCollection
|
// ButtonRefreshCollection
|
||||||
//
|
//
|
||||||
this.ButtonRefreshCollection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
ButtonRefreshCollection.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
this.ButtonRefreshCollection.Font = new System.Drawing.Font("Candara Light", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
ButtonRefreshCollection.Font = new Font("Candara Light", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
this.ButtonRefreshCollection.Location = new System.Drawing.Point(45, 663);
|
ButtonRefreshCollection.Location = new Point(45, 663);
|
||||||
this.ButtonRefreshCollection.Name = "ButtonRefreshCollection";
|
ButtonRefreshCollection.Name = "ButtonRefreshCollection";
|
||||||
this.ButtonRefreshCollection.Size = new System.Drawing.Size(150, 41);
|
ButtonRefreshCollection.Size = new Size(150, 41);
|
||||||
this.ButtonRefreshCollection.TabIndex = 2;
|
ButtonRefreshCollection.TabIndex = 2;
|
||||||
this.ButtonRefreshCollection.Text = "Обновить все";
|
ButtonRefreshCollection.Text = "Обновить все";
|
||||||
this.ButtonRefreshCollection.UseVisualStyleBackColor = true;
|
ButtonRefreshCollection.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// ButtonRemoveLocomotive
|
// ButtonRemoveLocomotive
|
||||||
//
|
//
|
||||||
this.ButtonRemoveLocomotive.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
ButtonRemoveLocomotive.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
this.ButtonRemoveLocomotive.Font = new System.Drawing.Font("Candara Light", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
ButtonRemoveLocomotive.Font = new Font("Candara Light", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
this.ButtonRemoveLocomotive.Location = new System.Drawing.Point(45, 590);
|
ButtonRemoveLocomotive.Location = new Point(45, 590);
|
||||||
this.ButtonRemoveLocomotive.Name = "ButtonRemoveLocomotive";
|
ButtonRemoveLocomotive.Name = "ButtonRemoveLocomotive";
|
||||||
this.ButtonRemoveLocomotive.Size = new System.Drawing.Size(150, 44);
|
ButtonRemoveLocomotive.Size = new Size(150, 44);
|
||||||
this.ButtonRemoveLocomotive.TabIndex = 1;
|
ButtonRemoveLocomotive.TabIndex = 1;
|
||||||
this.ButtonRemoveLocomotive.Text = "Удалить локо";
|
ButtonRemoveLocomotive.Text = "Удалить локо";
|
||||||
this.ButtonRemoveLocomotive.UseVisualStyleBackColor = true;
|
ButtonRemoveLocomotive.UseVisualStyleBackColor = true;
|
||||||
this.ButtonRemoveLocomotive.Click += new System.EventHandler(this.ButtonRemoveLocomotive_Click);
|
ButtonRemoveLocomotive.Click += ButtonRemoveLocomotive_Click;
|
||||||
//
|
//
|
||||||
// ButtonAddLocomotive
|
// ButtonAddLocomotive
|
||||||
//
|
//
|
||||||
this.ButtonAddLocomotive.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
ButtonAddLocomotive.Anchor = AnchorStyles.Top;
|
||||||
this.ButtonAddLocomotive.Font = new System.Drawing.Font("Candara Light", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
ButtonAddLocomotive.Font = new Font("Candara Light", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
this.ButtonAddLocomotive.Location = new System.Drawing.Point(42, 461);
|
ButtonAddLocomotive.Location = new Point(42, 461);
|
||||||
this.ButtonAddLocomotive.Name = "ButtonAddLocomotive";
|
ButtonAddLocomotive.Name = "ButtonAddLocomotive";
|
||||||
this.ButtonAddLocomotive.Size = new System.Drawing.Size(150, 39);
|
ButtonAddLocomotive.Size = new Size(150, 39);
|
||||||
this.ButtonAddLocomotive.TabIndex = 0;
|
ButtonAddLocomotive.TabIndex = 0;
|
||||||
this.ButtonAddLocomotive.Text = "Добавить локо";
|
ButtonAddLocomotive.Text = "Добавить локо";
|
||||||
this.ButtonAddLocomotive.UseVisualStyleBackColor = true;
|
ButtonAddLocomotive.UseVisualStyleBackColor = true;
|
||||||
this.ButtonAddLocomotive.Click += new System.EventHandler(this.ButtonAddLocomotive_Click);
|
ButtonAddLocomotive.Click += ButtonAddLocomotive_Click;
|
||||||
//
|
//
|
||||||
// pictureBoxCollections
|
// pictureBoxCollections
|
||||||
//
|
//
|
||||||
this.pictureBoxCollections.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
pictureBoxCollections.Anchor = AnchorStyles.Left;
|
||||||
this.pictureBoxCollections.Location = new System.Drawing.Point(-1, 27);
|
pictureBoxCollections.Location = new Point(-1, 27);
|
||||||
this.pictureBoxCollections.Name = "pictureBoxCollections";
|
pictureBoxCollections.Name = "pictureBoxCollections";
|
||||||
this.pictureBoxCollections.Size = new System.Drawing.Size(1104, 692);
|
pictureBoxCollections.Size = new Size(1104, 692);
|
||||||
this.pictureBoxCollections.TabIndex = 1;
|
pictureBoxCollections.TabIndex = 1;
|
||||||
this.pictureBoxCollections.TabStop = false;
|
pictureBoxCollections.TabStop = false;
|
||||||
//
|
//
|
||||||
// textBoxStorageName
|
// textBoxStorageName
|
||||||
//
|
//
|
||||||
this.textBoxStorageName.Location = new System.Drawing.Point(31, 43);
|
textBoxStorageName.Location = new Point(31, 43);
|
||||||
this.textBoxStorageName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
textBoxStorageName.Margin = new Padding(3, 4, 3, 4);
|
||||||
this.textBoxStorageName.Name = "textBoxStorageName";
|
textBoxStorageName.Name = "textBoxStorageName";
|
||||||
this.textBoxStorageName.Size = new System.Drawing.Size(149, 27);
|
textBoxStorageName.Size = new Size(149, 27);
|
||||||
this.textBoxStorageName.TabIndex = 5;
|
textBoxStorageName.TabIndex = 5;
|
||||||
//
|
//
|
||||||
// groupBox1
|
// groupBox1
|
||||||
//
|
//
|
||||||
this.groupBox1.Controls.Add(this.listBoxStorage);
|
groupBox1.Controls.Add(listBoxStorage);
|
||||||
this.groupBox1.Controls.Add(this.ButtonAddObject);
|
groupBox1.Controls.Add(ButtonAddObject);
|
||||||
this.groupBox1.Controls.Add(this.ButtonRemoveObject);
|
groupBox1.Controls.Add(ButtonRemoveObject);
|
||||||
this.groupBox1.Controls.Add(this.textBoxStorageName);
|
groupBox1.Controls.Add(textBoxStorageName);
|
||||||
this.groupBox1.Location = new System.Drawing.Point(7, 29);
|
groupBox1.Location = new Point(7, 29);
|
||||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
groupBox1.Margin = new Padding(3, 4, 3, 4);
|
||||||
this.groupBox1.Name = "groupBox1";
|
groupBox1.Name = "groupBox1";
|
||||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
groupBox1.Padding = new Padding(3, 4, 3, 4);
|
||||||
this.groupBox1.Size = new System.Drawing.Size(216, 395);
|
groupBox1.Size = new Size(216, 395);
|
||||||
this.groupBox1.TabIndex = 5;
|
groupBox1.TabIndex = 5;
|
||||||
this.groupBox1.TabStop = false;
|
groupBox1.TabStop = false;
|
||||||
this.groupBox1.Text = "Наборы";
|
groupBox1.Text = "Наборы";
|
||||||
//
|
//
|
||||||
// listBoxStorage
|
// listBoxStorage
|
||||||
//
|
//
|
||||||
this.listBoxStorage.FormattingEnabled = true;
|
listBoxStorage.FormattingEnabled = true;
|
||||||
this.listBoxStorage.ItemHeight = 20;
|
listBoxStorage.ItemHeight = 20;
|
||||||
this.listBoxStorage.Location = new System.Drawing.Point(31, 163);
|
listBoxStorage.Location = new Point(31, 163);
|
||||||
this.listBoxStorage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
listBoxStorage.Margin = new Padding(3, 4, 3, 4);
|
||||||
this.listBoxStorage.Name = "listBoxStorage";
|
listBoxStorage.Name = "listBoxStorage";
|
||||||
this.listBoxStorage.Size = new System.Drawing.Size(149, 124);
|
listBoxStorage.Size = new Size(149, 124);
|
||||||
this.listBoxStorage.TabIndex = 9;
|
listBoxStorage.TabIndex = 9;
|
||||||
this.listBoxStorage.SelectedIndexChanged += new System.EventHandler(this.listBoxStorage_SelectedIndexChanged);
|
listBoxStorage.SelectedIndexChanged += listBoxStorage_SelectedIndexChanged;
|
||||||
//
|
//
|
||||||
// ButtonAddObject
|
// ButtonAddObject
|
||||||
//
|
//
|
||||||
this.ButtonAddObject.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
ButtonAddObject.Anchor = AnchorStyles.Top;
|
||||||
this.ButtonAddObject.Font = new System.Drawing.Font("Candara Light", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
ButtonAddObject.Font = new Font("Candara Light", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
this.ButtonAddObject.Location = new System.Drawing.Point(31, 96);
|
ButtonAddObject.Location = new Point(31, 96);
|
||||||
this.ButtonAddObject.Name = "ButtonAddObject";
|
ButtonAddObject.Name = "ButtonAddObject";
|
||||||
this.ButtonAddObject.Size = new System.Drawing.Size(150, 39);
|
ButtonAddObject.Size = new Size(150, 39);
|
||||||
this.ButtonAddObject.TabIndex = 7;
|
ButtonAddObject.TabIndex = 7;
|
||||||
this.ButtonAddObject.Text = "Добавить набор";
|
ButtonAddObject.Text = "Добавить набор";
|
||||||
this.ButtonAddObject.UseVisualStyleBackColor = true;
|
ButtonAddObject.UseVisualStyleBackColor = true;
|
||||||
this.ButtonAddObject.Click += new System.EventHandler(this.ButtonAddObject_Click);
|
ButtonAddObject.Click += ButtonAddObject_Click;
|
||||||
//
|
//
|
||||||
// ButtonRemoveObject
|
// ButtonRemoveObject
|
||||||
//
|
//
|
||||||
this.ButtonRemoveObject.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
ButtonRemoveObject.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
this.ButtonRemoveObject.Font = new System.Drawing.Font("Candara Light", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
ButtonRemoveObject.Font = new Font("Candara Light", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
this.ButtonRemoveObject.Location = new System.Drawing.Point(31, 325);
|
ButtonRemoveObject.Location = new Point(31, 325);
|
||||||
this.ButtonRemoveObject.Name = "ButtonRemoveObject";
|
ButtonRemoveObject.Name = "ButtonRemoveObject";
|
||||||
this.ButtonRemoveObject.Size = new System.Drawing.Size(150, 44);
|
ButtonRemoveObject.Size = new Size(150, 44);
|
||||||
this.ButtonRemoveObject.TabIndex = 8;
|
ButtonRemoveObject.TabIndex = 8;
|
||||||
this.ButtonRemoveObject.Text = "Удалить набор";
|
ButtonRemoveObject.Text = "Удалить набор";
|
||||||
this.ButtonRemoveObject.UseVisualStyleBackColor = true;
|
ButtonRemoveObject.UseVisualStyleBackColor = true;
|
||||||
this.ButtonRemoveObject.Click += new System.EventHandler(this.ButtonRemoveObject_Click);
|
ButtonRemoveObject.Click += ButtonRemoveObject_Click;
|
||||||
//
|
//
|
||||||
// Instruments
|
// Instruments
|
||||||
//
|
//
|
||||||
this.Instruments.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
Instruments.Anchor = AnchorStyles.Right;
|
||||||
this.Instruments.Controls.Add(this.ButtonRefreshCollection);
|
Instruments.Controls.Add(ButtonRefreshCollection);
|
||||||
this.Instruments.Controls.Add(this.groupBox1);
|
Instruments.Controls.Add(groupBox1);
|
||||||
this.Instruments.Controls.Add(this.maskedTextBoxNumber);
|
Instruments.Controls.Add(maskedTextBoxNumber);
|
||||||
this.Instruments.Controls.Add(this.ButtonAddLocomotive);
|
Instruments.Controls.Add(ButtonAddLocomotive);
|
||||||
this.Instruments.Controls.Add(this.ButtonRemoveLocomotive);
|
Instruments.Controls.Add(ButtonRemoveLocomotive);
|
||||||
this.Instruments.Location = new System.Drawing.Point(1102, 0);
|
Instruments.Location = new Point(1102, 0);
|
||||||
this.Instruments.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
Instruments.Margin = new Padding(3, 4, 3, 4);
|
||||||
this.Instruments.Name = "Instruments";
|
Instruments.Name = "Instruments";
|
||||||
this.Instruments.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
Instruments.Padding = new Padding(3, 4, 3, 4);
|
||||||
this.Instruments.Size = new System.Drawing.Size(236, 719);
|
Instruments.Size = new Size(236, 719);
|
||||||
this.Instruments.TabIndex = 6;
|
Instruments.TabIndex = 6;
|
||||||
this.Instruments.TabStop = false;
|
Instruments.TabStop = false;
|
||||||
this.Instruments.Text = "Инструменты";
|
Instruments.Text = "Инструменты";
|
||||||
//
|
//
|
||||||
// menuStrip1
|
// menuStrip1
|
||||||
//
|
//
|
||||||
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
menuStrip1.ImageScalingSize = new Size(20, 20);
|
||||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
menuStrip1.Items.AddRange(new ToolStripItem[] { файлToolStripMenuItem });
|
||||||
this.файлToolStripMenuItem});
|
menuStrip1.Location = new Point(0, 0);
|
||||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
menuStrip1.Name = "menuStrip1";
|
||||||
this.menuStrip1.Name = "menuStrip1";
|
menuStrip1.Size = new Size(1338, 28);
|
||||||
this.menuStrip1.Size = new System.Drawing.Size(1338, 28);
|
menuStrip1.TabIndex = 7;
|
||||||
this.menuStrip1.TabIndex = 7;
|
menuStrip1.Text = "menuStrip1";
|
||||||
this.menuStrip1.Text = "menuStrip1";
|
|
||||||
//
|
//
|
||||||
// файлToolStripMenuItem
|
// файлToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.файлToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
файлToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { SaveToolStripMenuItem, LoadToolStripMenuItem });
|
||||||
this.SaveToolStripMenuItem,
|
файлToolStripMenuItem.Name = "файлToolStripMenuItem";
|
||||||
this.LoadToolStripMenuItem});
|
файлToolStripMenuItem.Size = new Size(59, 24);
|
||||||
this.файлToolStripMenuItem.Name = "файлToolStripMenuItem";
|
файлToolStripMenuItem.Text = "Файл";
|
||||||
this.файлToolStripMenuItem.Size = new System.Drawing.Size(59, 24);
|
|
||||||
this.файлToolStripMenuItem.Text = "Файл";
|
|
||||||
//
|
//
|
||||||
// SaveToolStripMenuItem
|
// SaveToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.SaveToolStripMenuItem.Name = "SaveToolStripMenuItem";
|
SaveToolStripMenuItem.Name = "SaveToolStripMenuItem";
|
||||||
this.SaveToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
SaveToolStripMenuItem.Size = new Size(166, 26);
|
||||||
this.SaveToolStripMenuItem.Text = "Сохранить";
|
SaveToolStripMenuItem.Text = "Сохранить";
|
||||||
this.SaveToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItem_Click);
|
SaveToolStripMenuItem.Click += SaveToolStripMenuItem_Click;
|
||||||
//
|
//
|
||||||
// LoadToolStripMenuItem
|
// LoadToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.LoadToolStripMenuItem.Name = "LoadToolStripMenuItem";
|
LoadToolStripMenuItem.Name = "LoadToolStripMenuItem";
|
||||||
this.LoadToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
LoadToolStripMenuItem.Size = new Size(166, 26);
|
||||||
this.LoadToolStripMenuItem.Text = "Загрузить";
|
LoadToolStripMenuItem.Text = "Загрузить";
|
||||||
this.LoadToolStripMenuItem.Click += new System.EventHandler(this.LoadToolStripMenuItem_Click);
|
LoadToolStripMenuItem.Click += LoadToolStripMenuItem_Click;
|
||||||
//
|
//
|
||||||
// saveFileDialog
|
// saveFileDialog
|
||||||
//
|
//
|
||||||
this.saveFileDialog.Filter = "txt file | *.txt";
|
saveFileDialog.Filter = "txt file | *.txt";
|
||||||
//
|
//
|
||||||
// openFileDialog
|
// openFileDialog
|
||||||
//
|
//
|
||||||
this.openFileDialog.FileName = "openFileDialog1";
|
openFileDialog.FileName = "openFileDialog1";
|
||||||
this.openFileDialog.Filter = "txt file | *.txt";
|
openFileDialog.Filter = "txt file | *.txt";
|
||||||
//
|
//
|
||||||
// FormLocomotiveCollections
|
// FormLocomotiveCollections
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(1338, 724);
|
ClientSize = new Size(1338, 724);
|
||||||
this.Controls.Add(this.Instruments);
|
Controls.Add(Instruments);
|
||||||
this.Controls.Add(this.pictureBoxCollections);
|
Controls.Add(pictureBoxCollections);
|
||||||
this.Controls.Add(this.menuStrip1);
|
Controls.Add(menuStrip1);
|
||||||
this.MainMenuStrip = this.menuStrip1;
|
MainMenuStrip = menuStrip1;
|
||||||
this.Name = "FormLocomotiveCollections";
|
Name = "FormLocomotiveCollections";
|
||||||
this.Text = "Набор локомотивов";
|
Text = "Набор локомотивов";
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCollections)).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureBoxCollections).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
|
((System.ComponentModel.ISupportInitialize)bindingSource1).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.bindingSource2)).EndInit();
|
((System.ComponentModel.ISupportInitialize)bindingSource2).EndInit();
|
||||||
this.groupBox1.ResumeLayout(false);
|
groupBox1.ResumeLayout(false);
|
||||||
this.groupBox1.PerformLayout();
|
groupBox1.PerformLayout();
|
||||||
this.Instruments.ResumeLayout(false);
|
Instruments.ResumeLayout(false);
|
||||||
this.Instruments.PerformLayout();
|
Instruments.PerformLayout();
|
||||||
this.menuStrip1.ResumeLayout(false);
|
menuStrip1.ResumeLayout(false);
|
||||||
this.menuStrip1.PerformLayout();
|
menuStrip1.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
this.PerformLayout();
|
PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1,4 +1,64 @@
|
|||||||
<root>
|
<?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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
@ -73,6 +133,6 @@
|
|||||||
<value>615, 17</value>
|
<value>615, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>144</value>
|
<value>84</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
</root>
|
</root>
|
@ -119,10 +119,9 @@ namespace ProjectElectricLocomotive.Generics
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
using StreamWriter fs = new StreamWriter(filename);
|
using StreamWriter fs = new StreamWriter(filename);
|
||||||
|
|
||||||
foreach(var str in _locomotivesStorage)
|
|
||||||
{
|
{
|
||||||
fs.WriteLine($"LocomotiveStorage{Environment.NewLine}{data}");
|
fs.WriteLine($"LocomotiveStorage{Environment.NewLine}");
|
||||||
|
fs.WriteLine(data);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -137,42 +136,65 @@ namespace ProjectElectricLocomotive.Generics
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//string bufferTextFromFile = "";
|
|
||||||
//using (FileStream fs = new(filename, FileMode.Open))
|
|
||||||
using (StreamReader fs = File.OpenText(filename))
|
using (StreamReader fs = File.OpenText(filename))
|
||||||
|
|
||||||
{
|
{
|
||||||
/* byte[] b = new byte[fs.Length];
|
|
||||||
UTF8Encoding temp = new(true);*/
|
|
||||||
/*while (fs.Read(b, 0, b.Length) > 0)
|
|
||||||
{
|
|
||||||
bufferTextFromFile += temp.GetString(b);
|
|
||||||
}*//*
|
|
||||||
|
|
||||||
List<string> strsh = new List<string>();
|
string str = fs.ReadLine();
|
||||||
|
|
||||||
string str;
|
|
||||||
while ((str = fs.ReadLine()) != null)
|
|
||||||
{
|
|
||||||
Console.WriteLine(str);
|
|
||||||
strsh.Add(str);
|
|
||||||
}*/
|
|
||||||
string? str = fs.ReadLine();
|
|
||||||
|
|
||||||
if (str == null || str.Length == 0)
|
if (str == null || str.Length == 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!str.Contains("LocomotiveStorage"))
|
if (!str.StartsWith("LocomotiveStorage"))
|
||||||
{
|
{
|
||||||
//если нет такой записи, то это не те данные
|
//если нет такой записи, то это не те данные
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_locomotivesStorage.Clear();
|
_locomotivesStorage.Clear();
|
||||||
|
string strs = "";
|
||||||
|
|
||||||
foreach(string data in str)
|
bool firstinit = true;
|
||||||
|
|
||||||
|
while ((strs = fs.ReadLine()) != null)
|
||||||
|
{
|
||||||
|
if (strs == null && firstinit)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (strs == null)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
firstinit = false;
|
||||||
|
|
||||||
|
string[] record = strs.Split(_separatorForKeyValue, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
if (record.Length != 2)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
LocomotiveGenericCollection<DrawingLocomotive, DrawingObjectLocomotive> collection = new(_pictureWidth, _pictureHeight);
|
||||||
|
string[] set = record[1].Split(_separatorRecords, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
foreach (string elem in set)
|
||||||
|
{
|
||||||
|
DrawingLocomotive? loco = elem?.CreateDrawingLocomotive(_separatorForObject, _pictureWidth, _pictureHeight);
|
||||||
|
if (loco != null)
|
||||||
|
{
|
||||||
|
if ((collection + loco) == -1) // or vice versa
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_locomotivesStorage.Add(record[0], collection);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*foreach(string data in str)
|
||||||
{
|
{
|
||||||
string[] record = data.Split(_separatorForKeyValue,
|
string[] record = data.Split(_separatorForKeyValue,
|
||||||
StringSplitOptions.RemoveEmptyEntries);
|
StringSplitOptions.RemoveEmptyEntries);
|
||||||
@ -200,7 +222,7 @@ namespace ProjectElectricLocomotive.Generics
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}*/
|
||||||
/*var strs = bufferTextFromFile.Split(new char[] { '\n', '\r' },
|
/*var strs = bufferTextFromFile.Split(new char[] { '\n', '\r' },
|
||||||
StringSplitOptions.RemoveEmptyEntries);
|
StringSplitOptions.RemoveEmptyEntries);
|
||||||
if (str == null || str.Length == 0)
|
if (str == null || str.Length == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user