Compare commits
7 Commits
5fe1a4cea1
...
release/v1
| Author | SHA1 | Date | |
|---|---|---|---|
| 835286b629 | |||
| fe5d22a811 | |||
| 808b0c4720 | |||
| 9be57d3c5f | |||
| 3d8b7e921a | |||
| 1082e63244 | |||
| a33baa2166 |
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36414.22
|
||||
# Visual Studio Version 18
|
||||
VisualStudioVersion = 18.3.11520.95 d18.3
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarManagerV3", "CarManagerV3\CarManagerV3.csproj", "{93CA258B-A645-41A8-A24F-59036ABC173F}"
|
||||
EndProject
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>true</SelfContained>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
@@ -20,6 +22,7 @@
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||
<ApplicationIcon>CarMgm_Icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Forms\Components\CarCard.cs">
|
||||
@@ -41,4 +44,7 @@
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="CarMgm_Icon.ico" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
BIN
CarManagerV3/CarMgm_Icon.ico
Normal file
BIN
CarManagerV3/CarMgm_Icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
511
CarManagerV3/Forms/CarDetailsForm.Designer.cs
generated
511
CarManagerV3/Forms/CarDetailsForm.Designer.cs
generated
@@ -29,327 +29,328 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CarDetailsForm));
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.pbxCarImage = new System.Windows.Forms.PictureBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.tbxMake = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.tbxModel = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnSave = new System.Windows.Forms.Button();
|
||||
this.btnDelete = new System.Windows.Forms.Button();
|
||||
this.lblID = new System.Windows.Forms.Label();
|
||||
this.tbxColor = new System.Windows.Forms.TextBox();
|
||||
this.nudMileage = new System.Windows.Forms.NumericUpDown();
|
||||
this.nudPrice = new System.Windows.Forms.NumericUpDown();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.nudYear = new System.Windows.Forms.NumericUpDown();
|
||||
this.lblAge = new System.Windows.Forms.Label();
|
||||
this.tbxAge = new System.Windows.Forms.TextBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbxCarImage)).BeginInit();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudMileage)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPrice)).BeginInit();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudYear)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
pbxCarImage = new System.Windows.Forms.PictureBox();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
tbxMake = new System.Windows.Forms.TextBox();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
tbxModel = new System.Windows.Forms.TextBox();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
label4 = new System.Windows.Forms.Label();
|
||||
label5 = new System.Windows.Forms.Label();
|
||||
label6 = new System.Windows.Forms.Label();
|
||||
flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
btnSave = new System.Windows.Forms.Button();
|
||||
btnDelete = new System.Windows.Forms.Button();
|
||||
lblID = new System.Windows.Forms.Label();
|
||||
tbxColor = new System.Windows.Forms.TextBox();
|
||||
nudMileage = new System.Windows.Forms.NumericUpDown();
|
||||
nudPrice = new System.Windows.Forms.NumericUpDown();
|
||||
tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
nudYear = new System.Windows.Forms.NumericUpDown();
|
||||
lblAge = new System.Windows.Forms.Label();
|
||||
tbxAge = new System.Windows.Forms.TextBox();
|
||||
tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pbxCarImage).BeginInit();
|
||||
flowLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)nudMileage).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudPrice).BeginInit();
|
||||
tableLayoutPanel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)nudYear).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.AutoSize = true;
|
||||
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.pbxCarImage, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tbxMake, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tbxModel, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label4, 0, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label6, 0, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 7);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tbxColor, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.nudMileage, 1, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.nudPrice, 1, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 3);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 8;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 200F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(536, 450);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
tableLayoutPanel1.AutoSize = true;
|
||||
tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
tableLayoutPanel1.ColumnCount = 2;
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F));
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
tableLayoutPanel1.Controls.Add(pbxCarImage, 0, 0);
|
||||
tableLayoutPanel1.Controls.Add(label1, 0, 1);
|
||||
tableLayoutPanel1.Controls.Add(tbxMake, 1, 1);
|
||||
tableLayoutPanel1.Controls.Add(label2, 0, 2);
|
||||
tableLayoutPanel1.Controls.Add(tbxModel, 1, 2);
|
||||
tableLayoutPanel1.Controls.Add(label3, 0, 3);
|
||||
tableLayoutPanel1.Controls.Add(label4, 0, 4);
|
||||
tableLayoutPanel1.Controls.Add(label5, 0, 5);
|
||||
tableLayoutPanel1.Controls.Add(label6, 0, 6);
|
||||
tableLayoutPanel1.Controls.Add(flowLayoutPanel1, 0, 7);
|
||||
tableLayoutPanel1.Controls.Add(tbxColor, 1, 4);
|
||||
tableLayoutPanel1.Controls.Add(nudMileage, 1, 5);
|
||||
tableLayoutPanel1.Controls.Add(nudPrice, 1, 6);
|
||||
tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 1, 3);
|
||||
tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 30, 4);
|
||||
tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
tableLayoutPanel1.RowCount = 8;
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 250F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
|
||||
tableLayoutPanel1.Size = new System.Drawing.Size(536, 562);
|
||||
tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// pbxCarImage
|
||||
//
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.pbxCarImage, 2);
|
||||
this.pbxCarImage.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pbxCarImage.Image = ((System.Drawing.Image)(resources.GetObject("pbxCarImage.Image")));
|
||||
this.pbxCarImage.Location = new System.Drawing.Point(3, 3);
|
||||
this.pbxCarImage.Name = "pbxCarImage";
|
||||
this.pbxCarImage.Size = new System.Drawing.Size(538, 194);
|
||||
this.pbxCarImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pbxCarImage.TabIndex = 0;
|
||||
this.pbxCarImage.TabStop = false;
|
||||
tableLayoutPanel1.SetColumnSpan(pbxCarImage, 2);
|
||||
pbxCarImage.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
pbxCarImage.Image = (System.Drawing.Image)resources.GetObject("pbxCarImage.Image");
|
||||
pbxCarImage.Location = new System.Drawing.Point(3, 4);
|
||||
pbxCarImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
pbxCarImage.Name = "pbxCarImage";
|
||||
pbxCarImage.Size = new System.Drawing.Size(530, 242);
|
||||
pbxCarImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
pbxCarImage.TabIndex = 0;
|
||||
pbxCarImage.TabStop = false;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(3, 200);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(59, 30);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Make:";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
label1.AutoSize = true;
|
||||
label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label1.Location = new System.Drawing.Point(3, 250);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(74, 38);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "Make:";
|
||||
label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// tbxMake
|
||||
//
|
||||
this.tbxMake.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbxMake.Location = new System.Drawing.Point(68, 203);
|
||||
this.tbxMake.Name = "tbxMake";
|
||||
this.tbxMake.Size = new System.Drawing.Size(473, 22);
|
||||
this.tbxMake.TabIndex = 1;
|
||||
this.tbxMake.TextChanged += new System.EventHandler(this.tbxMake_TextChanged);
|
||||
this.tbxMake.Leave += new System.EventHandler(this.tbxMake_Leave);
|
||||
tbxMake.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tbxMake.Location = new System.Drawing.Point(83, 254);
|
||||
tbxMake.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
tbxMake.Name = "tbxMake";
|
||||
tbxMake.Size = new System.Drawing.Size(450, 27);
|
||||
tbxMake.TabIndex = 1;
|
||||
tbxMake.TextChanged += tbxMake_TextChanged;
|
||||
tbxMake.Leave += tbxMake_Leave;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(3, 230);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(59, 30);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Model:";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
label2.AutoSize = true;
|
||||
label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label2.Location = new System.Drawing.Point(3, 288);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(74, 38);
|
||||
label2.TabIndex = 3;
|
||||
label2.Text = "Model:";
|
||||
label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// tbxModel
|
||||
//
|
||||
this.tbxModel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbxModel.Location = new System.Drawing.Point(68, 233);
|
||||
this.tbxModel.Name = "tbxModel";
|
||||
this.tbxModel.Size = new System.Drawing.Size(473, 22);
|
||||
this.tbxModel.TabIndex = 2;
|
||||
this.tbxModel.TextChanged += new System.EventHandler(this.tbxModel_TextChanged);
|
||||
this.tbxModel.Leave += new System.EventHandler(this.tbxModel_Leave);
|
||||
tbxModel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tbxModel.Location = new System.Drawing.Point(83, 292);
|
||||
tbxModel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
tbxModel.Name = "tbxModel";
|
||||
tbxModel.Size = new System.Drawing.Size(450, 27);
|
||||
tbxModel.TabIndex = 2;
|
||||
tbxModel.TextChanged += tbxModel_TextChanged;
|
||||
tbxModel.Leave += tbxModel_Leave;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label3.Location = new System.Drawing.Point(3, 260);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(59, 30);
|
||||
this.label3.TabIndex = 5;
|
||||
this.label3.Text = "Year:";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
label3.AutoSize = true;
|
||||
label3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label3.Location = new System.Drawing.Point(3, 326);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(74, 38);
|
||||
label3.TabIndex = 5;
|
||||
label3.Text = "Year:";
|
||||
label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label4.Location = new System.Drawing.Point(3, 290);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(59, 30);
|
||||
this.label4.TabIndex = 6;
|
||||
this.label4.Text = "Color:";
|
||||
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
label4.AutoSize = true;
|
||||
label4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label4.Location = new System.Drawing.Point(3, 364);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new System.Drawing.Size(74, 38);
|
||||
label4.TabIndex = 6;
|
||||
label4.Text = "Color:";
|
||||
label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label5.Location = new System.Drawing.Point(3, 320);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(59, 30);
|
||||
this.label5.TabIndex = 7;
|
||||
this.label5.Text = "Mileage:";
|
||||
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
label5.AutoSize = true;
|
||||
label5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label5.Location = new System.Drawing.Point(3, 402);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new System.Drawing.Size(74, 38);
|
||||
label5.TabIndex = 7;
|
||||
label5.Text = "Mileage:";
|
||||
label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label6.Location = new System.Drawing.Point(3, 350);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(59, 30);
|
||||
this.label6.TabIndex = 8;
|
||||
this.label6.Text = "Price:";
|
||||
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
label6.AutoSize = true;
|
||||
label6.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label6.Location = new System.Drawing.Point(3, 440);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new System.Drawing.Size(74, 38);
|
||||
label6.TabIndex = 8;
|
||||
label6.Text = "Price:";
|
||||
label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnSave);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnDelete);
|
||||
this.flowLayoutPanel1.Controls.Add(this.lblID);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 383);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(5);
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(538, 64);
|
||||
this.flowLayoutPanel1.TabIndex = 9;
|
||||
tableLayoutPanel1.SetColumnSpan(flowLayoutPanel1, 2);
|
||||
flowLayoutPanel1.Controls.Add(btnSave);
|
||||
flowLayoutPanel1.Controls.Add(btnDelete);
|
||||
flowLayoutPanel1.Controls.Add(lblID);
|
||||
flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
flowLayoutPanel1.Location = new System.Drawing.Point(3, 482);
|
||||
flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(5, 6, 5, 6);
|
||||
flowLayoutPanel1.Size = new System.Drawing.Size(530, 76);
|
||||
flowLayoutPanel1.TabIndex = 9;
|
||||
//
|
||||
// btnSave
|
||||
//
|
||||
this.btnSave.Location = new System.Drawing.Point(450, 8);
|
||||
this.btnSave.Name = "btnSave";
|
||||
this.btnSave.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnSave.TabIndex = 7;
|
||||
this.btnSave.Text = "Save";
|
||||
this.btnSave.UseVisualStyleBackColor = true;
|
||||
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||
btnSave.Location = new System.Drawing.Point(442, 10);
|
||||
btnSave.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
btnSave.Name = "btnSave";
|
||||
btnSave.Size = new System.Drawing.Size(75, 29);
|
||||
btnSave.TabIndex = 7;
|
||||
btnSave.Text = "Save";
|
||||
btnSave.UseVisualStyleBackColor = true;
|
||||
btnSave.Click += btnSave_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
this.btnDelete.Location = new System.Drawing.Point(369, 8);
|
||||
this.btnDelete.Name = "btnDelete";
|
||||
this.btnDelete.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnDelete.TabIndex = 8;
|
||||
this.btnDelete.Text = "Delete";
|
||||
this.btnDelete.UseVisualStyleBackColor = true;
|
||||
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
|
||||
btnDelete.Location = new System.Drawing.Point(361, 10);
|
||||
btnDelete.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new System.Drawing.Size(75, 29);
|
||||
btnDelete.TabIndex = 8;
|
||||
btnDelete.Text = "Delete";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// lblID
|
||||
//
|
||||
this.lblID.AutoSize = true;
|
||||
this.lblID.Location = new System.Drawing.Point(343, 5);
|
||||
this.lblID.Name = "lblID";
|
||||
this.lblID.Size = new System.Drawing.Size(20, 16);
|
||||
this.lblID.TabIndex = 2;
|
||||
this.lblID.Text = "ID";
|
||||
lblID.AutoSize = true;
|
||||
lblID.Location = new System.Drawing.Point(331, 6);
|
||||
lblID.Name = "lblID";
|
||||
lblID.Size = new System.Drawing.Size(24, 20);
|
||||
lblID.TabIndex = 2;
|
||||
lblID.Text = "ID";
|
||||
//
|
||||
// tbxColor
|
||||
//
|
||||
this.tbxColor.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbxColor.Location = new System.Drawing.Point(68, 293);
|
||||
this.tbxColor.Name = "tbxColor";
|
||||
this.tbxColor.Size = new System.Drawing.Size(473, 22);
|
||||
this.tbxColor.TabIndex = 4;
|
||||
this.tbxColor.TextChanged += new System.EventHandler(this.tbxColor_TextChanged);
|
||||
this.tbxColor.Leave += new System.EventHandler(this.tbxColor_Leave);
|
||||
tbxColor.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tbxColor.Location = new System.Drawing.Point(83, 368);
|
||||
tbxColor.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
tbxColor.Name = "tbxColor";
|
||||
tbxColor.Size = new System.Drawing.Size(450, 27);
|
||||
tbxColor.TabIndex = 4;
|
||||
tbxColor.TextChanged += tbxColor_TextChanged;
|
||||
tbxColor.Leave += tbxColor_Leave;
|
||||
//
|
||||
// nudMileage
|
||||
//
|
||||
this.nudMileage.Location = new System.Drawing.Point(68, 323);
|
||||
this.nudMileage.Maximum = new decimal(new int[] {
|
||||
999999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudMileage.Name = "nudMileage";
|
||||
this.nudMileage.Size = new System.Drawing.Size(120, 22);
|
||||
this.nudMileage.TabIndex = 5;
|
||||
this.nudMileage.ThousandsSeparator = true;
|
||||
this.nudMileage.ValueChanged += new System.EventHandler(this.nudMileage_ValueChanged);
|
||||
nudMileage.Location = new System.Drawing.Point(83, 406);
|
||||
nudMileage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
nudMileage.Maximum = new decimal(new int[] { 999999, 0, 0, 0 });
|
||||
nudMileage.Name = "nudMileage";
|
||||
nudMileage.Size = new System.Drawing.Size(120, 27);
|
||||
nudMileage.TabIndex = 5;
|
||||
nudMileage.ThousandsSeparator = true;
|
||||
nudMileage.ValueChanged += nudMileage_ValueChanged;
|
||||
//
|
||||
// nudPrice
|
||||
//
|
||||
this.nudPrice.DecimalPlaces = 2;
|
||||
this.nudPrice.Location = new System.Drawing.Point(68, 353);
|
||||
this.nudPrice.Maximum = new decimal(new int[] {
|
||||
999999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudPrice.Name = "nudPrice";
|
||||
this.nudPrice.Size = new System.Drawing.Size(120, 22);
|
||||
this.nudPrice.TabIndex = 6;
|
||||
this.nudPrice.ThousandsSeparator = true;
|
||||
this.nudPrice.ValueChanged += new System.EventHandler(this.nudPrice_ValueChanged);
|
||||
nudPrice.DecimalPlaces = 2;
|
||||
nudPrice.Location = new System.Drawing.Point(83, 444);
|
||||
nudPrice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
nudPrice.Maximum = new decimal(new int[] { 999999, 0, 0, 0 });
|
||||
nudPrice.Name = "nudPrice";
|
||||
nudPrice.Size = new System.Drawing.Size(120, 27);
|
||||
nudPrice.TabIndex = 6;
|
||||
nudPrice.ThousandsSeparator = true;
|
||||
nudPrice.ValueChanged += nudPrice_ValueChanged;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
this.tableLayoutPanel2.ColumnCount = 3;
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.tableLayoutPanel2.Controls.Add(this.nudYear, 0, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.lblAge, 1, 0);
|
||||
this.tableLayoutPanel2.Controls.Add(this.tbxAge, 2, 0);
|
||||
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel2.Location = new System.Drawing.Point(68, 263);
|
||||
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
this.tableLayoutPanel2.RowCount = 1;
|
||||
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel2.Size = new System.Drawing.Size(473, 24);
|
||||
this.tableLayoutPanel2.TabIndex = 10;
|
||||
tableLayoutPanel2.ColumnCount = 3;
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
tableLayoutPanel2.Controls.Add(nudYear, 0, 0);
|
||||
tableLayoutPanel2.Controls.Add(lblAge, 1, 0);
|
||||
tableLayoutPanel2.Controls.Add(tbxAge, 2, 0);
|
||||
tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel2.Location = new System.Drawing.Point(83, 330);
|
||||
tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
tableLayoutPanel2.RowCount = 1;
|
||||
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
tableLayoutPanel2.Size = new System.Drawing.Size(450, 30);
|
||||
tableLayoutPanel2.TabIndex = 10;
|
||||
//
|
||||
// nudYear
|
||||
//
|
||||
this.nudYear.Location = new System.Drawing.Point(3, 3);
|
||||
this.nudYear.Maximum = new decimal(new int[] {
|
||||
3000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudYear.Name = "nudYear";
|
||||
this.nudYear.Size = new System.Drawing.Size(120, 22);
|
||||
this.nudYear.TabIndex = 3;
|
||||
this.nudYear.ValueChanged += new System.EventHandler(this.nudYear_ValueChanged);
|
||||
nudYear.Location = new System.Drawing.Point(3, 4);
|
||||
nudYear.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
nudYear.Maximum = new decimal(new int[] { 3000, 0, 0, 0 });
|
||||
nudYear.Name = "nudYear";
|
||||
nudYear.Size = new System.Drawing.Size(120, 27);
|
||||
nudYear.TabIndex = 3;
|
||||
nudYear.ValueChanged += nudYear_ValueChanged;
|
||||
//
|
||||
// lblAge
|
||||
//
|
||||
this.lblAge.AutoSize = true;
|
||||
this.lblAge.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblAge.Location = new System.Drawing.Point(160, 0);
|
||||
this.lblAge.Name = "lblAge";
|
||||
this.lblAge.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.lblAge.Size = new System.Drawing.Size(151, 24);
|
||||
this.lblAge.TabIndex = 4;
|
||||
this.lblAge.Text = "Age";
|
||||
this.lblAge.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
lblAge.AutoSize = true;
|
||||
lblAge.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
lblAge.Location = new System.Drawing.Point(153, 0);
|
||||
lblAge.Name = "lblAge";
|
||||
lblAge.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
lblAge.Size = new System.Drawing.Size(144, 30);
|
||||
lblAge.TabIndex = 4;
|
||||
lblAge.Text = "Age";
|
||||
lblAge.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// tbxAge
|
||||
//
|
||||
this.tbxAge.Enabled = false;
|
||||
this.tbxAge.Location = new System.Drawing.Point(317, 3);
|
||||
this.tbxAge.Name = "tbxAge";
|
||||
this.tbxAge.ReadOnly = true;
|
||||
this.tbxAge.Size = new System.Drawing.Size(100, 22);
|
||||
this.tbxAge.TabIndex = 5;
|
||||
tbxAge.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tbxAge.Enabled = false;
|
||||
tbxAge.Location = new System.Drawing.Point(303, 4);
|
||||
tbxAge.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
tbxAge.Name = "tbxAge";
|
||||
tbxAge.ReadOnly = true;
|
||||
tbxAge.Size = new System.Drawing.Size(144, 27);
|
||||
tbxAge.TabIndex = 5;
|
||||
//
|
||||
// CarDetailsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(536, 450);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "CarDetailsForm";
|
||||
this.Text = "Details";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbxCarImage)).EndInit();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudMileage)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPrice)).EndInit();
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
this.tableLayoutPanel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudYear)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
ClientSize = new System.Drawing.Size(536, 562);
|
||||
Controls.Add(tableLayoutPanel1);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
MaximizeBox = false;
|
||||
Name = "CarDetailsForm";
|
||||
Text = "Details";
|
||||
tableLayoutPanel1.ResumeLayout(false);
|
||||
tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pbxCarImage).EndInit();
|
||||
flowLayoutPanel1.ResumeLayout(false);
|
||||
flowLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)nudMileage).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudPrice).EndInit();
|
||||
tableLayoutPanel2.ResumeLayout(false);
|
||||
tableLayoutPanel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)nudYear).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
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
|
||||
|
||||
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>
|
||||
@@ -26,36 +26,36 @@
|
||||
<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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
136
CarManagerV3/Forms/MainForm.Designer.cs
generated
136
CarManagerV3/Forms/MainForm.Designer.cs
generated
@@ -34,7 +34,6 @@
|
||||
flpCars = new System.Windows.Forms.FlowLayoutPanel();
|
||||
tlpControls = new System.Windows.Forms.TableLayoutPanel();
|
||||
btnNewCar = new System.Windows.Forms.Button();
|
||||
imageList1 = new System.Windows.Forms.ImageList(components);
|
||||
tlpSearch = new System.Windows.Forms.TableLayoutPanel();
|
||||
tbxSearch = new System.Windows.Forms.TextBox();
|
||||
pbxSearch = new System.Windows.Forms.PictureBox();
|
||||
@@ -43,9 +42,17 @@
|
||||
openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
recentFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
revealInFileExplorerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
addCarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
clearSearchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
openWelcomeScreenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
clearRecentFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
imageList1 = new System.Windows.Forms.ImageList(components);
|
||||
tableLayoutPanel1.SuspendLayout();
|
||||
tlpControls.SuspendLayout();
|
||||
tlpSearch.SuspendLayout();
|
||||
@@ -68,7 +75,7 @@
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.Size = new System.Drawing.Size(802, 572);
|
||||
tableLayoutPanel1.Size = new System.Drawing.Size(902, 653);
|
||||
tableLayoutPanel1.TabIndex = 0;
|
||||
tableLayoutPanel1.Paint += tableLayoutPanel1_Paint;
|
||||
//
|
||||
@@ -80,7 +87,7 @@
|
||||
flpCars.Location = new System.Drawing.Point(3, 82);
|
||||
flpCars.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
flpCars.Name = "flpCars";
|
||||
flpCars.Size = new System.Drawing.Size(796, 515);
|
||||
flpCars.Size = new System.Drawing.Size(896, 567);
|
||||
flpCars.TabIndex = 1;
|
||||
//
|
||||
// tlpControls
|
||||
@@ -91,12 +98,12 @@
|
||||
tlpControls.Controls.Add(btnNewCar, 1, 0);
|
||||
tlpControls.Controls.Add(tlpSearch, 0, 0);
|
||||
tlpControls.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tlpControls.Location = new System.Drawing.Point(3, 28);
|
||||
tlpControls.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
tlpControls.Location = new System.Drawing.Point(0, 28);
|
||||
tlpControls.Margin = new System.Windows.Forms.Padding(0);
|
||||
tlpControls.Name = "tlpControls";
|
||||
tlpControls.RowCount = 1;
|
||||
tlpControls.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
tlpControls.Size = new System.Drawing.Size(796, 50);
|
||||
tlpControls.Size = new System.Drawing.Size(902, 50);
|
||||
tlpControls.TabIndex = 2;
|
||||
//
|
||||
// btnNewCar
|
||||
@@ -107,9 +114,8 @@
|
||||
btnNewCar.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
btnNewCar.FlatAppearance.BorderSize = 0;
|
||||
btnNewCar.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
btnNewCar.ImageKey = "Icon_Add.png";
|
||||
btnNewCar.ImageList = imageList1;
|
||||
btnNewCar.Location = new System.Drawing.Point(716, 0);
|
||||
btnNewCar.Image = (System.Drawing.Image)resources.GetObject("btnNewCar.Image");
|
||||
btnNewCar.Location = new System.Drawing.Point(822, 0);
|
||||
btnNewCar.Margin = new System.Windows.Forms.Padding(0);
|
||||
btnNewCar.Name = "btnNewCar";
|
||||
btnNewCar.Size = new System.Drawing.Size(80, 50);
|
||||
@@ -117,14 +123,6 @@
|
||||
btnNewCar.UseVisualStyleBackColor = false;
|
||||
btnNewCar.Click += btnNewCar_Click;
|
||||
//
|
||||
// imageList1
|
||||
//
|
||||
imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
|
||||
imageList1.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList1.ImageStream");
|
||||
imageList1.TransparentColor = System.Drawing.Color.Transparent;
|
||||
imageList1.Images.SetKeyName(0, "Icon_Search.png");
|
||||
imageList1.Images.SetKeyName(1, "Icon_Add.png");
|
||||
//
|
||||
// tlpSearch
|
||||
//
|
||||
tlpSearch.BackColor = System.Drawing.SystemColors.Window;
|
||||
@@ -140,7 +138,7 @@
|
||||
tlpSearch.RowCount = 1;
|
||||
tlpSearch.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tlpSearch.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
tlpSearch.Size = new System.Drawing.Size(716, 50);
|
||||
tlpSearch.Size = new System.Drawing.Size(822, 50);
|
||||
tlpSearch.TabIndex = 5;
|
||||
//
|
||||
// tbxSearch
|
||||
@@ -152,7 +150,7 @@
|
||||
tbxSearch.Location = new System.Drawing.Point(53, 15);
|
||||
tbxSearch.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
tbxSearch.Name = "tbxSearch";
|
||||
tbxSearch.Size = new System.Drawing.Size(660, 20);
|
||||
tbxSearch.Size = new System.Drawing.Size(766, 20);
|
||||
tbxSearch.TabIndex = 3;
|
||||
tbxSearch.TextChanged += tbxSearch_TextChanged;
|
||||
//
|
||||
@@ -170,23 +168,26 @@
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
menuStrip1.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem });
|
||||
menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, editToolStripMenuItem, toolsToolStripMenuItem });
|
||||
menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
menuStrip1.Name = "menuStrip1";
|
||||
menuStrip1.Size = new System.Drawing.Size(802, 28);
|
||||
menuStrip1.Size = new System.Drawing.Size(902, 28);
|
||||
menuStrip1.TabIndex = 3;
|
||||
menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { openToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, importToolStripMenuItem, recentFilesToolStripMenuItem, revealInFileExplorerToolStripMenuItem });
|
||||
fileToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { openToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, recentFilesToolStripMenuItem, revealInFileExplorerToolStripMenuItem, exitToolStripMenuItem });
|
||||
fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24);
|
||||
fileToolStripMenuItem.Text = "File";
|
||||
//
|
||||
// openToolStripMenuItem
|
||||
//
|
||||
openToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
openToolStripMenuItem.Name = "openToolStripMenuItem";
|
||||
openToolStripMenuItem.Size = new System.Drawing.Size(238, 26);
|
||||
openToolStripMenuItem.Text = "Open";
|
||||
@@ -194,6 +195,7 @@
|
||||
//
|
||||
// saveToolStripMenuItem
|
||||
//
|
||||
saveToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
saveToolStripMenuItem.Name = "saveToolStripMenuItem";
|
||||
saveToolStripMenuItem.Size = new System.Drawing.Size(238, 26);
|
||||
saveToolStripMenuItem.Text = "Save";
|
||||
@@ -206,13 +208,6 @@
|
||||
saveAsToolStripMenuItem.Text = "Save as";
|
||||
saveAsToolStripMenuItem.Click += saveAsToolStripMenuItem_Click;
|
||||
//
|
||||
// importToolStripMenuItem
|
||||
//
|
||||
importToolStripMenuItem.Name = "importToolStripMenuItem";
|
||||
importToolStripMenuItem.Size = new System.Drawing.Size(238, 26);
|
||||
importToolStripMenuItem.Text = "Import";
|
||||
importToolStripMenuItem.Click += importToolStripMenuItem_Click;
|
||||
//
|
||||
// recentFilesToolStripMenuItem
|
||||
//
|
||||
recentFilesToolStripMenuItem.Name = "recentFilesToolStripMenuItem";
|
||||
@@ -227,17 +222,85 @@
|
||||
revealInFileExplorerToolStripMenuItem.Text = "Reveal in File Explorer";
|
||||
revealInFileExplorerToolStripMenuItem.Click += revealInFileExplorerToolStripMenuItem_Click;
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
exitToolStripMenuItem.Size = new System.Drawing.Size(238, 26);
|
||||
exitToolStripMenuItem.Text = "Save and Exit";
|
||||
exitToolStripMenuItem.Click += exitToolStripMenuItem_Click;
|
||||
//
|
||||
// editToolStripMenuItem
|
||||
//
|
||||
editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { addCarToolStripMenuItem, importToolStripMenuItem, clearSearchToolStripMenuItem });
|
||||
editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||
editToolStripMenuItem.Size = new System.Drawing.Size(49, 24);
|
||||
editToolStripMenuItem.Text = "Edit";
|
||||
//
|
||||
// addCarToolStripMenuItem
|
||||
//
|
||||
addCarToolStripMenuItem.Name = "addCarToolStripMenuItem";
|
||||
addCarToolStripMenuItem.Size = new System.Drawing.Size(174, 26);
|
||||
addCarToolStripMenuItem.Text = "Add Car";
|
||||
addCarToolStripMenuItem.Click += addCarToolStripMenuItem_Click;
|
||||
//
|
||||
// importToolStripMenuItem
|
||||
//
|
||||
importToolStripMenuItem.Name = "importToolStripMenuItem";
|
||||
importToolStripMenuItem.Size = new System.Drawing.Size(174, 26);
|
||||
importToolStripMenuItem.Text = "Import";
|
||||
importToolStripMenuItem.Click += importToolStripMenuItem_Click;
|
||||
//
|
||||
// clearSearchToolStripMenuItem
|
||||
//
|
||||
clearSearchToolStripMenuItem.Name = "clearSearchToolStripMenuItem";
|
||||
clearSearchToolStripMenuItem.Size = new System.Drawing.Size(174, 26);
|
||||
clearSearchToolStripMenuItem.Text = "Clear Search";
|
||||
clearSearchToolStripMenuItem.Click += clearSearchToolStripMenuItem_Click;
|
||||
//
|
||||
// toolsToolStripMenuItem
|
||||
//
|
||||
toolsToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { openWelcomeScreenToolStripMenuItem, clearRecentFilesToolStripMenuItem });
|
||||
toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
|
||||
toolsToolStripMenuItem.Size = new System.Drawing.Size(58, 24);
|
||||
toolsToolStripMenuItem.Text = "Tools";
|
||||
//
|
||||
// openWelcomeScreenToolStripMenuItem
|
||||
//
|
||||
openWelcomeScreenToolStripMenuItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
openWelcomeScreenToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
openWelcomeScreenToolStripMenuItem.Name = "openWelcomeScreenToolStripMenuItem";
|
||||
openWelcomeScreenToolStripMenuItem.Size = new System.Drawing.Size(238, 26);
|
||||
openWelcomeScreenToolStripMenuItem.Text = "Open welcome screen";
|
||||
openWelcomeScreenToolStripMenuItem.Click += openWelcomeScreenToolStripMenuItem_Click;
|
||||
//
|
||||
// clearRecentFilesToolStripMenuItem
|
||||
//
|
||||
clearRecentFilesToolStripMenuItem.Name = "clearRecentFilesToolStripMenuItem";
|
||||
clearRecentFilesToolStripMenuItem.Size = new System.Drawing.Size(238, 26);
|
||||
clearRecentFilesToolStripMenuItem.Text = "Clear recent files";
|
||||
clearRecentFilesToolStripMenuItem.Click += clearRecentFilesToolStripMenuItem_Click;
|
||||
//
|
||||
// imageList1
|
||||
//
|
||||
imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
|
||||
imageList1.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList1.ImageStream");
|
||||
imageList1.TransparentColor = System.Drawing.Color.Transparent;
|
||||
imageList1.Images.SetKeyName(0, "Icon_Search.png");
|
||||
imageList1.Images.SetKeyName(1, "Icon_Add.png");
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
ClientSize = new System.Drawing.Size(802, 572);
|
||||
ClientSize = new System.Drawing.Size(902, 653);
|
||||
Controls.Add(tableLayoutPanel1);
|
||||
Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
|
||||
MainMenuStrip = menuStrip1;
|
||||
Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
MinimumSize = new System.Drawing.Size(818, 609);
|
||||
MinimumSize = new System.Drawing.Size(920, 700);
|
||||
Name = "MainForm";
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
Text = "Carmanager 3";
|
||||
tableLayoutPanel1.ResumeLayout(false);
|
||||
tableLayoutPanel1.PerformLayout();
|
||||
@@ -263,11 +326,18 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem recentFilesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem revealInFileExplorerToolStripMenuItem;
|
||||
private System.Windows.Forms.TableLayoutPanel tlpSearch;
|
||||
private System.Windows.Forms.PictureBox pbxSearch;
|
||||
private System.Windows.Forms.ImageList imageList1;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem openWelcomeScreenToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem addCarToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem clearSearchToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem clearRecentFilesToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,14 @@ using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using CarManagerV3.Forms;
|
||||
|
||||
namespace CarManagerV3
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
List<Car> cars = new List<Car>();
|
||||
string filepath = "cars.csv";
|
||||
string filepath = "";
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
@@ -18,14 +19,18 @@ namespace CarManagerV3
|
||||
|
||||
// Open the most recent file if it exists. Otherwise, use default filepath.
|
||||
List<string> recentFiles = SafeManager.GetRecentPaths();
|
||||
if(recentFiles.Count > 0)
|
||||
if (recentFiles.Count > 0)
|
||||
{
|
||||
filepath = recentFiles[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
openWelcomeScreen();
|
||||
}
|
||||
|
||||
SafeManager.InitializeFile(filepath);
|
||||
StateManager.setFilePath(filepath);
|
||||
try
|
||||
try
|
||||
{
|
||||
List<Car> _cars = SafeManager.ReadCars(filepath);
|
||||
cars = _cars;
|
||||
@@ -41,11 +46,44 @@ namespace CarManagerV3
|
||||
|
||||
}
|
||||
|
||||
public void openWelcomeScreen()
|
||||
{
|
||||
Welcome welcome = new Welcome();
|
||||
// disable main form while welcome screen is open
|
||||
this.Enabled = false;
|
||||
welcome.OpenFileCallback = () =>
|
||||
{
|
||||
showOpenFileDialog();
|
||||
if (filepath != "")
|
||||
{
|
||||
welcome.Close();
|
||||
this.Enabled = true;
|
||||
}
|
||||
};
|
||||
welcome.NewFileCallback = () =>
|
||||
{
|
||||
showSaveAsDialog();
|
||||
if (filepath != "")
|
||||
{
|
||||
welcome.Close();
|
||||
this.Enabled = true;
|
||||
}
|
||||
};
|
||||
|
||||
welcome.ShowDialog();
|
||||
|
||||
}
|
||||
|
||||
public void showOpenFileDialog()
|
||||
{
|
||||
openToolStripMenuItem.PerformClick();
|
||||
}
|
||||
|
||||
|
||||
public void showSaveAsDialog()
|
||||
{
|
||||
saveAsToolStripMenuItem.PerformClick();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes the cars displayed in the flow layout panel.
|
||||
@@ -264,12 +302,12 @@ namespace CarManagerV3
|
||||
try
|
||||
{
|
||||
List<Car> importedCars = SafeManager.ReadCars(dlgOpen.FileName);
|
||||
if(importedCars.Count == 0)
|
||||
if (importedCars.Count == 0)
|
||||
{
|
||||
throw new Exception("File doesn't contain valid Cars.");
|
||||
}
|
||||
filepath = dlgOpen.FileName;
|
||||
|
||||
|
||||
cars = importedCars;
|
||||
StateManager.setFilePath(filepath);
|
||||
// Refresh display
|
||||
@@ -343,7 +381,7 @@ namespace CarManagerV3
|
||||
{
|
||||
Console.WriteLine("Starting merge...");
|
||||
List<Car> importedCars = SafeManager.ReadCars(dlgOpen.FileName);
|
||||
if(importedCars.Count == 0)
|
||||
if (importedCars.Count == 0)
|
||||
{
|
||||
throw new Exception("File doesn't contain valid Cars.");
|
||||
}
|
||||
@@ -398,7 +436,7 @@ namespace CarManagerV3
|
||||
// TODO: Unbind and remove this.
|
||||
private void recentFilesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -418,7 +456,7 @@ namespace CarManagerV3
|
||||
try
|
||||
{
|
||||
List<Car> importedCars = SafeManager.ReadCars(path);
|
||||
if(importedCars.Count == 0)
|
||||
if (importedCars.Count == 0)
|
||||
{
|
||||
throw new Exception("File doesn't contain valid Cars.");
|
||||
}
|
||||
@@ -429,6 +467,10 @@ namespace CarManagerV3
|
||||
refreshCars(cars);
|
||||
MessageBox.Show("File loaded successfully.", "Load File", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
catch (LegacyException)
|
||||
{
|
||||
MessageBox.Show("The file you are trying to open is in a legacy format that is no longer supported. Please convert the file to the new format and try again.", "Load Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error loading file: " + ex.Message);
|
||||
@@ -451,5 +493,31 @@ namespace CarManagerV3
|
||||
MessageBox.Show("File does not exist.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void openWelcomeScreenToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
openWelcomeScreen();
|
||||
}
|
||||
|
||||
private void addCarToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnNewCar.PerformClick();
|
||||
}
|
||||
|
||||
private void clearSearchToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
tbxSearch.Text = "";
|
||||
}
|
||||
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SafeManager.SaveCars(filepath, cars);
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private void clearRecentFilesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SafeManager.ClearRecentPaths();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
274
CarManagerV3/Forms/Welcome.Designer.cs
generated
Normal file
274
CarManagerV3/Forms/Welcome.Designer.cs
generated
Normal file
@@ -0,0 +1,274 @@
|
||||
namespace CarManagerV3.Forms
|
||||
{
|
||||
partial class Welcome
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Welcome));
|
||||
tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
pbxLogo = new System.Windows.Forms.PictureBox();
|
||||
lblWelcome = new System.Windows.Forms.Label();
|
||||
flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
label4 = new System.Windows.Forms.Label();
|
||||
flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
btnNewFile = new System.Windows.Forms.Button();
|
||||
btnOpenFile = new System.Windows.Forms.Button();
|
||||
btnExit = new System.Windows.Forms.Button();
|
||||
tableLayoutPanel1.SuspendLayout();
|
||||
tableLayoutPanel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pbxLogo).BeginInit();
|
||||
flowLayoutPanel1.SuspendLayout();
|
||||
flowLayoutPanel2.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
tableLayoutPanel1.ColumnCount = 1;
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 0, 0);
|
||||
tableLayoutPanel1.Controls.Add(flowLayoutPanel1, 0, 1);
|
||||
tableLayoutPanel1.Controls.Add(flowLayoutPanel2, 0, 2);
|
||||
tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
|
||||
tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
tableLayoutPanel1.RowCount = 3;
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 200F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
|
||||
tableLayoutPanel1.Size = new System.Drawing.Size(590, 492);
|
||||
tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
tableLayoutPanel2.BackColor = System.Drawing.SystemColors.MenuHighlight;
|
||||
tableLayoutPanel2.ColumnCount = 1;
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
tableLayoutPanel2.Controls.Add(pbxLogo, 0, 0);
|
||||
tableLayoutPanel2.Controls.Add(lblWelcome, 0, 1);
|
||||
tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel2.ForeColor = System.Drawing.SystemColors.Window;
|
||||
tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
|
||||
tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
|
||||
tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
tableLayoutPanel2.RowCount = 2;
|
||||
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 70F));
|
||||
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
|
||||
tableLayoutPanel2.Size = new System.Drawing.Size(590, 200);
|
||||
tableLayoutPanel2.TabIndex = 1;
|
||||
//
|
||||
// pbxLogo
|
||||
//
|
||||
pbxLogo.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
pbxLogo.Image = (System.Drawing.Image)resources.GetObject("pbxLogo.Image");
|
||||
pbxLogo.Location = new System.Drawing.Point(3, 15);
|
||||
pbxLogo.Margin = new System.Windows.Forms.Padding(3, 15, 3, 3);
|
||||
pbxLogo.Name = "pbxLogo";
|
||||
pbxLogo.Size = new System.Drawing.Size(584, 122);
|
||||
pbxLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
pbxLogo.TabIndex = 0;
|
||||
pbxLogo.TabStop = false;
|
||||
//
|
||||
// lblWelcome
|
||||
//
|
||||
lblWelcome.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
lblWelcome.AutoSize = true;
|
||||
lblWelcome.Font = new System.Drawing.Font("Segoe UI", 20F, System.Drawing.FontStyle.Bold);
|
||||
lblWelcome.Location = new System.Drawing.Point(0, 147);
|
||||
lblWelcome.Margin = new System.Windows.Forms.Padding(0);
|
||||
lblWelcome.Name = "lblWelcome";
|
||||
lblWelcome.Size = new System.Drawing.Size(590, 46);
|
||||
lblWelcome.TabIndex = 1;
|
||||
lblWelcome.Text = "Welcome to Car Manager";
|
||||
lblWelcome.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
flowLayoutPanel1.Controls.Add(label1);
|
||||
flowLayoutPanel1.Controls.Add(label2);
|
||||
flowLayoutPanel1.Controls.Add(label3);
|
||||
flowLayoutPanel1.Controls.Add(label4);
|
||||
flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
flowLayoutPanel1.Location = new System.Drawing.Point(3, 203);
|
||||
flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(20, 20, 20, 0);
|
||||
flowLayoutPanel1.Size = new System.Drawing.Size(584, 236);
|
||||
flowLayoutPanel1.TabIndex = 2;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
label1.Location = new System.Drawing.Point(23, 20);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(396, 20);
|
||||
label1.TabIndex = 0;
|
||||
label1.Text = "Car Manager lets you manage your lot easier than ever!";
|
||||
label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new System.Drawing.Point(23, 40);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(310, 20);
|
||||
label2.TabIndex = 1;
|
||||
label2.Text = "Get started by creating or opening a .CSV file.";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.ForeColor = System.Drawing.SystemColors.AppWorkspace;
|
||||
label3.Location = new System.Drawing.Point(23, 110);
|
||||
label3.Margin = new System.Windows.Forms.Padding(3, 50, 3, 0);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(203, 20);
|
||||
label3.TabIndex = 2;
|
||||
label3.Text = "Developed by Jaro Kaulmann";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.ForeColor = System.Drawing.SystemColors.AppWorkspace;
|
||||
label4.Location = new System.Drawing.Point(23, 130);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new System.Drawing.Size(204, 20);
|
||||
label4.TabIndex = 3;
|
||||
label4.Text = "Copyright © Jaro.digital 2026";
|
||||
//
|
||||
// flowLayoutPanel2
|
||||
//
|
||||
flowLayoutPanel2.Controls.Add(btnNewFile);
|
||||
flowLayoutPanel2.Controls.Add(btnOpenFile);
|
||||
flowLayoutPanel2.Controls.Add(btnExit);
|
||||
flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
flowLayoutPanel2.Location = new System.Drawing.Point(3, 445);
|
||||
flowLayoutPanel2.Name = "flowLayoutPanel2";
|
||||
flowLayoutPanel2.Size = new System.Drawing.Size(584, 44);
|
||||
flowLayoutPanel2.TabIndex = 3;
|
||||
//
|
||||
// btnNewFile
|
||||
//
|
||||
btnNewFile.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnNewFile.AutoSize = true;
|
||||
btnNewFile.BackColor = System.Drawing.SystemColors.MenuHighlight;
|
||||
btnNewFile.FlatAppearance.BorderSize = 0;
|
||||
btnNewFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
btnNewFile.ForeColor = System.Drawing.SystemColors.Window;
|
||||
btnNewFile.Location = new System.Drawing.Point(434, 3);
|
||||
btnNewFile.Name = "btnNewFile";
|
||||
btnNewFile.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
btnNewFile.Size = new System.Drawing.Size(147, 36);
|
||||
btnNewFile.TabIndex = 2;
|
||||
btnNewFile.Text = "New File";
|
||||
btnNewFile.UseVisualStyleBackColor = false;
|
||||
btnNewFile.Click += btnNewFile_Click;
|
||||
//
|
||||
// btnOpenFile
|
||||
//
|
||||
btnOpenFile.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnOpenFile.AutoSize = true;
|
||||
btnOpenFile.BackColor = System.Drawing.SystemColors.HotTrack;
|
||||
btnOpenFile.FlatAppearance.BorderSize = 0;
|
||||
btnOpenFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
btnOpenFile.ForeColor = System.Drawing.SystemColors.Window;
|
||||
btnOpenFile.Location = new System.Drawing.Point(281, 3);
|
||||
btnOpenFile.Name = "btnOpenFile";
|
||||
btnOpenFile.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
btnOpenFile.Size = new System.Drawing.Size(147, 36);
|
||||
btnOpenFile.TabIndex = 0;
|
||||
btnOpenFile.Text = "Open a File";
|
||||
btnOpenFile.UseVisualStyleBackColor = false;
|
||||
btnOpenFile.Click += btnOpenFile_Click;
|
||||
//
|
||||
// btnExit
|
||||
//
|
||||
btnExit.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnExit.AutoSize = true;
|
||||
btnExit.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
btnExit.FlatAppearance.BorderSize = 0;
|
||||
btnExit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
btnExit.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
btnExit.Location = new System.Drawing.Point(172, 3);
|
||||
btnExit.Name = "btnExit";
|
||||
btnExit.Padding = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
btnExit.Size = new System.Drawing.Size(103, 36);
|
||||
btnExit.TabIndex = 1;
|
||||
btnExit.Text = "Exit";
|
||||
btnExit.UseVisualStyleBackColor = false;
|
||||
btnExit.Click += btnExit_Click;
|
||||
//
|
||||
// Welcome
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
ClientSize = new System.Drawing.Size(590, 492);
|
||||
ControlBox = false;
|
||||
Controls.Add(tableLayoutPanel1);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
|
||||
Name = "Welcome";
|
||||
ShowInTaskbar = false;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
Text = "Welcome";
|
||||
TopMost = true;
|
||||
Load += Welcome_Load;
|
||||
tableLayoutPanel1.ResumeLayout(false);
|
||||
tableLayoutPanel2.ResumeLayout(false);
|
||||
tableLayoutPanel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pbxLogo).EndInit();
|
||||
flowLayoutPanel1.ResumeLayout(false);
|
||||
flowLayoutPanel1.PerformLayout();
|
||||
flowLayoutPanel2.ResumeLayout(false);
|
||||
flowLayoutPanel2.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.PictureBox pbxLogo;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.Label lblWelcome;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button btnOpenFile;
|
||||
private System.Windows.Forms.Button btnExit;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
|
||||
private System.Windows.Forms.Button btnNewFile;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
}
|
||||
}
|
||||
48
CarManagerV3/Forms/Welcome.cs
Normal file
48
CarManagerV3/Forms/Welcome.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CarManagerV3.Forms
|
||||
{
|
||||
public partial class Welcome : Form
|
||||
{
|
||||
|
||||
// callback functions
|
||||
// Open file
|
||||
public Action OpenFileCallback;
|
||||
|
||||
public Action NewFileCallback;
|
||||
|
||||
|
||||
public Welcome()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Welcome_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void btnOpenFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.OpenFileCallback();
|
||||
}
|
||||
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private void btnNewFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.NewFileCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
5013
CarManagerV3/Forms/Welcome.resx
Normal file
5013
CarManagerV3/Forms/Welcome.resx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -8,12 +8,15 @@ namespace CarManagerV3
|
||||
/// </summary>
|
||||
internal class ImageManager
|
||||
{
|
||||
|
||||
private static string _imagePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\CarManagerV3\\images";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the image folder by creating it if it does not exist.
|
||||
/// </summary>
|
||||
public static void InitializeImageFolder()
|
||||
{
|
||||
string path = "images";
|
||||
string path = _imagePath;
|
||||
|
||||
if (!System.IO.Directory.Exists(path))
|
||||
{
|
||||
@@ -31,7 +34,7 @@ namespace CarManagerV3
|
||||
/// <returns>The image path for this Car.</returns>
|
||||
public static string GetImagePath(Car car)
|
||||
{
|
||||
string basePath = "images/";
|
||||
string basePath = $"{_imagePath}/";
|
||||
string fileName = $"{car.Make}_{car.Model}_{car.Year}_{car.Color}.png";
|
||||
return basePath + fileName;
|
||||
}
|
||||
@@ -60,7 +63,7 @@ namespace CarManagerV3
|
||||
}
|
||||
try
|
||||
{
|
||||
return Image.FromFile("images/no_image_available.png");
|
||||
return Image.FromFile($"{_imagePath}/no_image_available.png");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -97,7 +100,7 @@ namespace CarManagerV3
|
||||
catch
|
||||
{
|
||||
// if error, use fallback image no_image_available.png
|
||||
System.IO.File.Copy("images/no_image_available.png", path);
|
||||
//System.IO.File.Copy($"{_imagePath}/no_image_available.png", path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ namespace CarManagerV3
|
||||
/// <summary>
|
||||
/// The path of the txt file that contains recently opened file paths.
|
||||
/// </summary>
|
||||
private static readonly string recentPathsFile = "recent_paths.txt";
|
||||
private static readonly string recentPathsFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\CarManagerV3\\recent_paths.txt";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a file at a specified path if it does not already exist.
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="path">The path of the file.</param>
|
||||
public static void InitializeFile(string path)
|
||||
{
|
||||
try
|
||||
@@ -31,7 +31,7 @@ namespace CarManagerV3
|
||||
using (StreamWriter writer = new StreamWriter(@path))
|
||||
{
|
||||
// Create the file, empty
|
||||
writer.WriteLine();
|
||||
//writer.WriteLine();
|
||||
writer.Close();
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,27 @@ namespace CarManagerV3
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a file and its parent folders at a specified path if they do not already exist.
|
||||
/// </summary>
|
||||
/// <param name="path">The path of the file.</param>
|
||||
public static void initializeFileAndFolders(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
string directory = Path.GetDirectoryName(path);
|
||||
if (!Directory.Exists(directory))
|
||||
{
|
||||
Directory.CreateDirectory(directory);
|
||||
}
|
||||
InitializeFile(path);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Error.WriteLine($"Error initializing file and folders: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads cars from a specified file path.
|
||||
/// </summary>
|
||||
@@ -150,18 +171,7 @@ namespace CarManagerV3
|
||||
List<string> paths = new List<string>();
|
||||
try
|
||||
{
|
||||
if (File.Exists(recentPathsFile))
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(recentPathsFile))
|
||||
{
|
||||
string line;
|
||||
while ((line = reader.ReadLine()) != null)
|
||||
{
|
||||
paths.Add(line);
|
||||
}
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
paths = GetRecentPaths();
|
||||
paths.Remove(path);
|
||||
paths.Insert(0, path);
|
||||
if (paths.Count > 5)
|
||||
@@ -194,7 +204,8 @@ namespace CarManagerV3
|
||||
List<string> paths = new List<string>();
|
||||
try
|
||||
{
|
||||
if (File.Exists(recentPathsFile))
|
||||
initializeFileAndFolders(recentPathsFile);
|
||||
if (File.Exists(recentPathsFile)) //TODO: Remove
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(recentPathsFile))
|
||||
{
|
||||
@@ -215,9 +226,11 @@ namespace CarManagerV3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the folder of the most recently opened file, or the users documents folder if no recent files.
|
||||
/// Gets the folder of the most recently opened file.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <returns>
|
||||
/// The folder path of the most recently opened file, or the users documents folder if no recent files.
|
||||
/// </returns>
|
||||
public static string getRecentFolder()
|
||||
{
|
||||
List<string> recentPaths = GetRecentPaths();
|
||||
@@ -232,7 +245,23 @@ namespace CarManagerV3
|
||||
return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Clears the recently opened file paths list by deleting the recent paths file.
|
||||
/// </summary>
|
||||
public static void ClearRecentPaths()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(recentPathsFile))
|
||||
{
|
||||
File.Delete(recentPathsFile);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Error.WriteLine($"Error clearing recent paths: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,7 @@ namespace CarManagerV3
|
||||
// Initialize global static list of cars
|
||||
static List<Car> cars = new List<Car>();
|
||||
// Initialize default file path for car data.
|
||||
// TODO: If no recent file paths are found, prompt user to select a file path instead of using a hardcoded default in the program folder.
|
||||
static string filePath = "cars.csv";
|
||||
static string filePath = "";
|
||||
|
||||
static bool hasConfirmedMigration = false;
|
||||
|
||||
@@ -46,7 +45,7 @@ namespace CarManagerV3
|
||||
/// <summary>
|
||||
/// Adds a car to the collection.
|
||||
/// </summary>
|
||||
/// <param name="car">The car to add.</param>
|
||||
/// <param name="car">The <see cref="Car"/> to add.</param>
|
||||
public static void AddCar(Car car)
|
||||
{
|
||||
cars = SafeManager.ReadCars(filePath);
|
||||
@@ -57,7 +56,7 @@ namespace CarManagerV3
|
||||
/// <summary>
|
||||
/// Removes a car from the collection.
|
||||
/// </summary>
|
||||
/// <param name="car">The car to remove.</param>
|
||||
/// <param name="car">The <see cref="Car"/> to remove.</param>
|
||||
public static void RemoveCar(Car car)
|
||||
{
|
||||
cars = SafeManager.ReadCars(filePath);
|
||||
@@ -73,7 +72,7 @@ namespace CarManagerV3
|
||||
/// <remarks>
|
||||
/// If the car's Id has changed during editing, this will not work correctly. Keep Id immutable!
|
||||
/// </remarks>
|
||||
/// <param name="car">The car to update.</param>
|
||||
/// <param name="car">The <see cref="Car"/> to update.</param>
|
||||
public static void UpdateCar(Car car)
|
||||
{
|
||||
Car existingCar = GetCarById(car.Id);
|
||||
@@ -119,6 +118,11 @@ namespace CarManagerV3
|
||||
filePath = path;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Normalizes the orders of the cars in the collection to be sequential starting from 1, while keeping the relative order the same.
|
||||
/// </summary>
|
||||
/// <param name="cars">The list of <see cref="Car"/>s.</param>
|
||||
/// <returns>A normalized List of <see cref="Car"/>s </returns>
|
||||
public static List<Car> normalizeOrders(List<Car> cars)
|
||||
{
|
||||
// Normalize the Order field of all cars to be sequential starting from 1, while keeping the relative order the same.
|
||||
@@ -130,6 +134,11 @@ namespace CarManagerV3
|
||||
return orderedCars;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prompts the user to confirm migration if they haven't already confirmed it for the current session.
|
||||
/// This is to prevent multiple annoying popups if the user tries to open multiple files that require migration.
|
||||
/// </summary>
|
||||
/// <returns>True if the user has accepted to migrate the file, otherwise False</returns>
|
||||
public static bool askForMigration()
|
||||
{
|
||||
if (hasConfirmedMigration)
|
||||
|
||||
Reference in New Issue
Block a user