PIbd-23_Nasyrov_A_G_Lab6 #8
@ -39,18 +39,21 @@
|
||||
buttonDeleteAirplane = new Button();
|
||||
buttonAddAirplane = new Button();
|
||||
maskedTextBoxNumber = new MaskedTextBox();
|
||||
groupBoxRecord = new GroupBox();
|
||||
LoadToolStripMenuItem = new Button();
|
||||
SaveToolStripMenuItem = new Button();
|
||||
menuStrip1 = new MenuStrip();
|
||||
файлToolStripMenuItem = new ToolStripMenuItem();
|
||||
SaveToolStripMenuItem = new ToolStripMenuItem();
|
||||
LoadToolStripMenuItem = new ToolStripMenuItem();
|
||||
openFileDialog = new OpenFileDialog();
|
||||
saveFileDialog = new SaveFileDialog();
|
||||
((System.ComponentModel.ISupportInitialize)pictureBoxAirplanesCollection).BeginInit();
|
||||
groupBoxAirplaneWithRadar.SuspendLayout();
|
||||
groupBoxCollection.SuspendLayout();
|
||||
groupBoxRecord.SuspendLayout();
|
||||
menuStrip1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// pictureBoxAirplanesCollection
|
||||
//
|
||||
pictureBoxAirplanesCollection.Location = new Point(-9, 0);
|
||||
pictureBoxAirplanesCollection.Location = new Point(0, 38);
|
||||
pictureBoxAirplanesCollection.Name = "pictureBoxAirplanesCollection";
|
||||
pictureBoxAirplanesCollection.Size = new Size(650, 454);
|
||||
pictureBoxAirplanesCollection.SizeMode = PictureBoxSizeMode.AutoSize;
|
||||
@ -60,16 +63,15 @@
|
||||
//
|
||||
// groupBoxAirplaneWithRadar
|
||||
//
|
||||
groupBoxAirplaneWithRadar.Controls.Add(groupBoxRecord);
|
||||
groupBoxAirplaneWithRadar.Controls.Add(groupBoxCollection);
|
||||
groupBoxAirplaneWithRadar.Controls.Add(buttonUpdateCollection);
|
||||
groupBoxAirplaneWithRadar.Controls.Add(buttonDeleteAirplane);
|
||||
groupBoxAirplaneWithRadar.Controls.Add(buttonAddAirplane);
|
||||
groupBoxAirplaneWithRadar.Controls.Add(maskedTextBoxNumber);
|
||||
groupBoxAirplaneWithRadar.Dock = DockStyle.Right;
|
||||
groupBoxAirplaneWithRadar.Location = new Point(643, 0);
|
||||
groupBoxAirplaneWithRadar.Location = new Point(650, 28);
|
||||
groupBoxAirplaneWithRadar.Name = "groupBoxAirplaneWithRadar";
|
||||
groupBoxAirplaneWithRadar.Size = new Size(460, 453);
|
||||
groupBoxAirplaneWithRadar.Size = new Size(251, 464);
|
||||
groupBoxAirplaneWithRadar.TabIndex = 1;
|
||||
groupBoxAirplaneWithRadar.TabStop = false;
|
||||
groupBoxAirplaneWithRadar.Text = "Инструменты";
|
||||
@ -161,42 +163,49 @@
|
||||
maskedTextBoxNumber.Size = new Size(125, 27);
|
||||
maskedTextBoxNumber.TabIndex = 0;
|
||||
//
|
||||
// groupBoxRecord
|
||||
// menuStrip1
|
||||
//
|
||||
groupBoxRecord.Controls.Add(SaveToolStripMenuItem);
|
||||
groupBoxRecord.Controls.Add(LoadToolStripMenuItem);
|
||||
groupBoxRecord.Location = new Point(250, 26);
|
||||
groupBoxRecord.Name = "groupBoxRecord";
|
||||
groupBoxRecord.Size = new Size(204, 103);
|
||||
groupBoxRecord.TabIndex = 5;
|
||||
groupBoxRecord.TabStop = false;
|
||||
groupBoxRecord.Text = "Запись";
|
||||
menuStrip1.ImageScalingSize = new Size(20, 20);
|
||||
menuStrip1.Items.AddRange(new ToolStripItem[] { файлToolStripMenuItem });
|
||||
menuStrip1.Location = new Point(0, 0);
|
||||
menuStrip1.Name = "menuStrip1";
|
||||
menuStrip1.Size = new Size(901, 28);
|
||||
menuStrip1.TabIndex = 2;
|
||||
menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// LoadToolStripMenuItem
|
||||
// файлToolStripMenuItem
|
||||
//
|
||||
LoadToolStripMenuItem.Location = new Point(6, 61);
|
||||
LoadToolStripMenuItem.Name = "LoadToolStripMenuItem";
|
||||
LoadToolStripMenuItem.Size = new Size(192, 29);
|
||||
LoadToolStripMenuItem.TabIndex = 0;
|
||||
LoadToolStripMenuItem.Text = "Загрузить";
|
||||
LoadToolStripMenuItem.UseVisualStyleBackColor = true;
|
||||
файлToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { SaveToolStripMenuItem, LoadToolStripMenuItem });
|
||||
файлToolStripMenuItem.Name = "файлToolStripMenuItem";
|
||||
файлToolStripMenuItem.Size = new Size(59, 24);
|
||||
файлToolStripMenuItem.Text = "Файл";
|
||||
//
|
||||
// SaveToolStripMenuItem
|
||||
//
|
||||
SaveToolStripMenuItem.Location = new Point(6, 26);
|
||||
SaveToolStripMenuItem.Name = "SaveToolStripMenuItem";
|
||||
SaveToolStripMenuItem.Size = new Size(192, 29);
|
||||
SaveToolStripMenuItem.TabIndex = 1;
|
||||
SaveToolStripMenuItem.Size = new Size(224, 26);
|
||||
SaveToolStripMenuItem.Text = "Сохранить";
|
||||
SaveToolStripMenuItem.UseVisualStyleBackColor = true;
|
||||
SaveToolStripMenuItem.Click += SaveToolStripMenuItem_Click_1;
|
||||
//
|
||||
// LoadToolStripMenuItem
|
||||
//
|
||||
LoadToolStripMenuItem.Name = "LoadToolStripMenuItem";
|
||||
LoadToolStripMenuItem.Size = new Size(224, 26);
|
||||
LoadToolStripMenuItem.Text = "Загрузить";
|
||||
LoadToolStripMenuItem.Click += LoadToolStripMenuItem_Click;
|
||||
//
|
||||
// openFileDialog
|
||||
//
|
||||
openFileDialog.FileName = "openFileDialog1";
|
||||
//
|
||||
// FormAirplanesCollection
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1103, 453);
|
||||
ClientSize = new Size(901, 492);
|
||||
Controls.Add(groupBoxAirplaneWithRadar);
|
||||
Controls.Add(pictureBoxAirplanesCollection);
|
||||
Controls.Add(menuStrip1);
|
||||
Name = "FormAirplanesCollection";
|
||||
Text = "FormAirplaneWithRadar";
|
||||
((System.ComponentModel.ISupportInitialize)pictureBoxAirplanesCollection).EndInit();
|
||||
@ -204,7 +213,8 @@
|
||||
groupBoxAirplaneWithRadar.PerformLayout();
|
||||
groupBoxCollection.ResumeLayout(false);
|
||||
groupBoxCollection.PerformLayout();
|
||||
groupBoxRecord.ResumeLayout(false);
|
||||
menuStrip1.ResumeLayout(false);
|
||||
menuStrip1.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
@ -222,8 +232,11 @@
|
||||
private ListBox listBoxStorages;
|
||||
private Button buttonAddObject;
|
||||
private TextBox textBoxStorageName;
|
||||
private GroupBox groupBoxRecord;
|
||||
private Button SaveToolStripMenuItem;
|
||||
private Button LoadToolStripMenuItem;
|
||||
private MenuStrip menuStrip1;
|
||||
private ToolStripMenuItem файлToolStripMenuItem;
|
||||
private ToolStripMenuItem SaveToolStripMenuItem;
|
||||
private ToolStripMenuItem LoadToolStripMenuItem;
|
||||
private OpenFileDialog openFileDialog;
|
||||
private SaveFileDialog saveFileDialog;
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ using ProjectAirplaneWithRadar.DrawningObjects;
|
||||
using ProjectAirplaneWithRadar.MovementStrategy;
|
||||
using ProjectAirplaneWithRadar.Generics;
|
||||
using System.Diagnostics.Metrics;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectAirplaneWithRadar
|
||||
{
|
||||
@ -139,5 +140,41 @@ namespace ProjectAirplaneWithRadar
|
||||
{
|
||||
|
||||
}
|
||||
private void SaveToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (_storage.SaveData(saveFileDialog.FileName))
|
||||
{
|
||||
MessageBox.Show("Ñîõðàíåíèå ïðîøëî óñïåøíî",
|
||||
"Ðåçóëüòàò", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Íå ñîõðàíèëîñü", "Ðåçóëüòàò",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void LoadToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (_storage.LoadData(openFileDialog.FileName))
|
||||
{
|
||||
MessageBox.Show("Çàãðóçêà ïðîøëà óñïåøíî",
|
||||
"Ðåçóëüòàò", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
foreach (var collection in _storage.Keys)
|
||||
{
|
||||
listBoxStorages.Items.Add(collection);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Íå çàãðóçèëîñü", "Ðåçóëüòàò",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -117,4 +117,13 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>153, 17</value>
|
||||
</metadata>
|
||||
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>323, 17</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
x
Reference in New Issue
Block a user