Compare commits
8 Commits
1.1
...
release/v1
| Author | SHA1 | Date | |
|---|---|---|---|
| f2e4addbb0 | |||
| 6958781dec | |||
| d3d704ebf4 | |||
| 49c963078a | |||
| 11ea32b490 | |||
| b20f92274f | |||
| ff3805f8d1 | |||
| bf42b4219b |
1067
CarManager3Setup/CarManager3Setup.vdproj
Normal file
1067
CarManager3Setup/CarManager3Setup.vdproj
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,12 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 18
|
||||
VisualStudioVersion = 18.3.11520.95 d18.3
|
||||
VisualStudioVersion = 18.3.11520.95
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarManagerV3", "CarManagerV3\CarManagerV3.csproj", "{93CA258B-A645-41A8-A24F-59036ABC173F}"
|
||||
EndProject
|
||||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "CarManager3Setup", "CarManager3Setup\CarManager3Setup.vdproj", "{47ED51EB-1DD0-B8F0-88C8-92C6E3E06030}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -15,6 +17,8 @@ Global
|
||||
{93CA258B-A645-41A8-A24F-59036ABC173F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{93CA258B-A645-41A8-A24F-59036ABC173F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{93CA258B-A645-41A8-A24F-59036ABC173F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{47ED51EB-1DD0-B8F0-88C8-92C6E3E06030}.Debug|Any CPU.ActiveCfg = Debug
|
||||
{47ED51EB-1DD0-B8F0-88C8-92C6E3E06030}.Release|Any CPU.ActiveCfg = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="CarManagerV3.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<CarManagerV3.Properties.Settings>
|
||||
<setting name="DataLocation" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</CarManagerV3.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
@@ -23,11 +23,21 @@
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||
<ApplicationIcon>CarMgm_Icon.ico</ApplicationIcon>
|
||||
<AssemblyTitle>Car Manager 3</AssemblyTitle>
|
||||
<Version>1.3</Version>
|
||||
<AssemblyVersion>1.3.0</AssemblyVersion>
|
||||
<FileVersion>1.3.0</FileVersion>
|
||||
<Product>Car Manager 3</Product>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Forms\Components\CarCard.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
@@ -47,4 +57,10 @@
|
||||
<ItemGroup>
|
||||
<Content Include="CarMgm_Icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
119
CarManagerV3/Forms/CarDetailsForm.Designer.cs
generated
119
CarManagerV3/Forms/CarDetailsForm.Designer.cs
generated
@@ -64,7 +64,7 @@
|
||||
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.Absolute, 70F));
|
||||
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);
|
||||
@@ -82,18 +82,18 @@
|
||||
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.Margin = new System.Windows.Forms.Padding(3, 3, 26, 3);
|
||||
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, 188F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
|
||||
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.Size = new System.Drawing.Size(469, 422);
|
||||
tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// pbxCarImage
|
||||
@@ -101,10 +101,9 @@
|
||||
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.Location = new System.Drawing.Point(3, 3);
|
||||
pbxCarImage.Name = "pbxCarImage";
|
||||
pbxCarImage.Size = new System.Drawing.Size(530, 242);
|
||||
pbxCarImage.Size = new System.Drawing.Size(463, 182);
|
||||
pbxCarImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
pbxCarImage.TabIndex = 0;
|
||||
pbxCarImage.TabStop = false;
|
||||
@@ -113,9 +112,9 @@
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label1.Location = new System.Drawing.Point(3, 250);
|
||||
label1.Location = new System.Drawing.Point(3, 188);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(74, 38);
|
||||
label1.Size = new System.Drawing.Size(64, 28);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "Make:";
|
||||
label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@@ -123,10 +122,9 @@
|
||||
// tbxMake
|
||||
//
|
||||
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.Location = new System.Drawing.Point(73, 191);
|
||||
tbxMake.Name = "tbxMake";
|
||||
tbxMake.Size = new System.Drawing.Size(450, 27);
|
||||
tbxMake.Size = new System.Drawing.Size(393, 23);
|
||||
tbxMake.TabIndex = 1;
|
||||
tbxMake.TextChanged += tbxMake_TextChanged;
|
||||
tbxMake.Leave += tbxMake_Leave;
|
||||
@@ -135,9 +133,9 @@
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label2.Location = new System.Drawing.Point(3, 288);
|
||||
label2.Location = new System.Drawing.Point(3, 216);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(74, 38);
|
||||
label2.Size = new System.Drawing.Size(64, 28);
|
||||
label2.TabIndex = 3;
|
||||
label2.Text = "Model:";
|
||||
label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@@ -145,10 +143,9 @@
|
||||
// tbxModel
|
||||
//
|
||||
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.Location = new System.Drawing.Point(73, 219);
|
||||
tbxModel.Name = "tbxModel";
|
||||
tbxModel.Size = new System.Drawing.Size(450, 27);
|
||||
tbxModel.Size = new System.Drawing.Size(393, 23);
|
||||
tbxModel.TabIndex = 2;
|
||||
tbxModel.TextChanged += tbxModel_TextChanged;
|
||||
tbxModel.Leave += tbxModel_Leave;
|
||||
@@ -157,9 +154,9 @@
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label3.Location = new System.Drawing.Point(3, 326);
|
||||
label3.Location = new System.Drawing.Point(3, 244);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(74, 38);
|
||||
label3.Size = new System.Drawing.Size(64, 28);
|
||||
label3.TabIndex = 5;
|
||||
label3.Text = "Year:";
|
||||
label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@@ -168,9 +165,9 @@
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label4.Location = new System.Drawing.Point(3, 364);
|
||||
label4.Location = new System.Drawing.Point(3, 272);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new System.Drawing.Size(74, 38);
|
||||
label4.Size = new System.Drawing.Size(64, 28);
|
||||
label4.TabIndex = 6;
|
||||
label4.Text = "Color:";
|
||||
label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@@ -179,9 +176,9 @@
|
||||
//
|
||||
label5.AutoSize = true;
|
||||
label5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label5.Location = new System.Drawing.Point(3, 402);
|
||||
label5.Location = new System.Drawing.Point(3, 300);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new System.Drawing.Size(74, 38);
|
||||
label5.Size = new System.Drawing.Size(64, 28);
|
||||
label5.TabIndex = 7;
|
||||
label5.Text = "Mileage:";
|
||||
label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@@ -190,9 +187,9 @@
|
||||
//
|
||||
label6.AutoSize = true;
|
||||
label6.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
label6.Location = new System.Drawing.Point(3, 440);
|
||||
label6.Location = new System.Drawing.Point(3, 328);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new System.Drawing.Size(74, 38);
|
||||
label6.Size = new System.Drawing.Size(64, 28);
|
||||
label6.TabIndex = 8;
|
||||
label6.Text = "Price:";
|
||||
label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@@ -205,19 +202,17 @@
|
||||
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.Location = new System.Drawing.Point(3, 359);
|
||||
flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(5, 6, 5, 6);
|
||||
flowLayoutPanel1.Size = new System.Drawing.Size(530, 76);
|
||||
flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(4);
|
||||
flowLayoutPanel1.Size = new System.Drawing.Size(463, 60);
|
||||
flowLayoutPanel1.TabIndex = 9;
|
||||
//
|
||||
// btnSave
|
||||
//
|
||||
btnSave.Location = new System.Drawing.Point(442, 10);
|
||||
btnSave.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
btnSave.Location = new System.Drawing.Point(386, 7);
|
||||
btnSave.Name = "btnSave";
|
||||
btnSave.Size = new System.Drawing.Size(75, 29);
|
||||
btnSave.Size = new System.Drawing.Size(66, 22);
|
||||
btnSave.TabIndex = 7;
|
||||
btnSave.Text = "Save";
|
||||
btnSave.UseVisualStyleBackColor = true;
|
||||
@@ -225,10 +220,9 @@
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Location = new System.Drawing.Point(361, 10);
|
||||
btnDelete.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
btnDelete.Location = new System.Drawing.Point(314, 7);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new System.Drawing.Size(75, 29);
|
||||
btnDelete.Size = new System.Drawing.Size(66, 22);
|
||||
btnDelete.TabIndex = 8;
|
||||
btnDelete.Text = "Delete";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
@@ -237,30 +231,28 @@
|
||||
// lblID
|
||||
//
|
||||
lblID.AutoSize = true;
|
||||
lblID.Location = new System.Drawing.Point(331, 6);
|
||||
lblID.Location = new System.Drawing.Point(290, 4);
|
||||
lblID.Name = "lblID";
|
||||
lblID.Size = new System.Drawing.Size(24, 20);
|
||||
lblID.Size = new System.Drawing.Size(18, 15);
|
||||
lblID.TabIndex = 2;
|
||||
lblID.Text = "ID";
|
||||
//
|
||||
// tbxColor
|
||||
//
|
||||
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.Location = new System.Drawing.Point(73, 275);
|
||||
tbxColor.Name = "tbxColor";
|
||||
tbxColor.Size = new System.Drawing.Size(450, 27);
|
||||
tbxColor.Size = new System.Drawing.Size(393, 23);
|
||||
tbxColor.TabIndex = 4;
|
||||
tbxColor.TextChanged += tbxColor_TextChanged;
|
||||
tbxColor.Leave += tbxColor_Leave;
|
||||
//
|
||||
// nudMileage
|
||||
//
|
||||
nudMileage.Location = new System.Drawing.Point(83, 406);
|
||||
nudMileage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
nudMileage.Location = new System.Drawing.Point(73, 303);
|
||||
nudMileage.Maximum = new decimal(new int[] { 999999, 0, 0, 0 });
|
||||
nudMileage.Name = "nudMileage";
|
||||
nudMileage.Size = new System.Drawing.Size(120, 27);
|
||||
nudMileage.Size = new System.Drawing.Size(105, 23);
|
||||
nudMileage.TabIndex = 5;
|
||||
nudMileage.ThousandsSeparator = true;
|
||||
nudMileage.ValueChanged += nudMileage_ValueChanged;
|
||||
@@ -268,11 +260,10 @@
|
||||
// nudPrice
|
||||
//
|
||||
nudPrice.DecimalPlaces = 2;
|
||||
nudPrice.Location = new System.Drawing.Point(83, 444);
|
||||
nudPrice.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
nudPrice.Location = new System.Drawing.Point(73, 331);
|
||||
nudPrice.Maximum = new decimal(new int[] { 999999, 0, 0, 0 });
|
||||
nudPrice.Name = "nudPrice";
|
||||
nudPrice.Size = new System.Drawing.Size(120, 27);
|
||||
nudPrice.Size = new System.Drawing.Size(105, 23);
|
||||
nudPrice.TabIndex = 6;
|
||||
nudPrice.ThousandsSeparator = true;
|
||||
nudPrice.ValueChanged += nudPrice_ValueChanged;
|
||||
@@ -287,21 +278,19 @@
|
||||
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.Location = new System.Drawing.Point(73, 247);
|
||||
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.Size = new System.Drawing.Size(393, 22);
|
||||
tableLayoutPanel2.TabIndex = 10;
|
||||
//
|
||||
// nudYear
|
||||
//
|
||||
nudYear.Location = new System.Drawing.Point(3, 4);
|
||||
nudYear.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
nudYear.Location = new System.Drawing.Point(3, 3);
|
||||
nudYear.Maximum = new decimal(new int[] { 3000, 0, 0, 0 });
|
||||
nudYear.Name = "nudYear";
|
||||
nudYear.Size = new System.Drawing.Size(120, 27);
|
||||
nudYear.Size = new System.Drawing.Size(105, 23);
|
||||
nudYear.TabIndex = 3;
|
||||
nudYear.ValueChanged += nudYear_ValueChanged;
|
||||
//
|
||||
@@ -309,10 +298,10 @@
|
||||
//
|
||||
lblAge.AutoSize = true;
|
||||
lblAge.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
lblAge.Location = new System.Drawing.Point(153, 0);
|
||||
lblAge.Location = new System.Drawing.Point(134, 0);
|
||||
lblAge.Name = "lblAge";
|
||||
lblAge.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
lblAge.Size = new System.Drawing.Size(144, 30);
|
||||
lblAge.Size = new System.Drawing.Size(125, 22);
|
||||
lblAge.TabIndex = 4;
|
||||
lblAge.Text = "Age";
|
||||
lblAge.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
@@ -321,21 +310,19 @@
|
||||
//
|
||||
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.Location = new System.Drawing.Point(265, 3);
|
||||
tbxAge.Name = "tbxAge";
|
||||
tbxAge.ReadOnly = true;
|
||||
tbxAge.Size = new System.Drawing.Size(144, 27);
|
||||
tbxAge.Size = new System.Drawing.Size(125, 23);
|
||||
tbxAge.TabIndex = 5;
|
||||
//
|
||||
// CarDetailsForm
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
ClientSize = new System.Drawing.Size(536, 562);
|
||||
ClientSize = new System.Drawing.Size(469, 422);
|
||||
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";
|
||||
|
||||
121
CarManagerV3/Forms/Components/CarCard.Designer.cs
generated
121
CarManagerV3/Forms/Components/CarCard.Designer.cs
generated
@@ -29,81 +29,82 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CarCard));
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.lblCarDetails = new System.Windows.Forms.Label();
|
||||
this.lblCarName = new System.Windows.Forms.Label();
|
||||
this.pbxCar = new System.Windows.Forms.PictureBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbxCar)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
lblCarDetails = new System.Windows.Forms.Label();
|
||||
lblCarName = new System.Windows.Forms.Label();
|
||||
pbxCar = new System.Windows.Forms.PictureBox();
|
||||
tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pbxCar).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.AutoSize = true;
|
||||
this.tableLayoutPanel1.ColumnCount = 1;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblCarDetails, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblCarName, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.pbxCar, 0, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.MaximumSize = new System.Drawing.Size(210, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 3;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 130F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(210, 200);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
tableLayoutPanel1.AutoSize = true;
|
||||
tableLayoutPanel1.ColumnCount = 1;
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
tableLayoutPanel1.Controls.Add(lblCarDetails, 0, 2);
|
||||
tableLayoutPanel1.Controls.Add(lblCarName, 0, 1);
|
||||
tableLayoutPanel1.Controls.Add(pbxCar, 0, 0);
|
||||
tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
tableLayoutPanel1.MaximumSize = new System.Drawing.Size(184, 0);
|
||||
tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
tableLayoutPanel1.RowCount = 3;
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 122F));
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.Size = new System.Drawing.Size(184, 188);
|
||||
tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// lblCarDetails
|
||||
//
|
||||
this.lblCarDetails.AutoSize = true;
|
||||
this.lblCarDetails.Location = new System.Drawing.Point(3, 174);
|
||||
this.lblCarDetails.Name = "lblCarDetails";
|
||||
this.lblCarDetails.Size = new System.Drawing.Size(101, 16);
|
||||
this.lblCarDetails.TabIndex = 5;
|
||||
this.lblCarDetails.Text = "2009 - 13.000km";
|
||||
lblCarDetails.AutoSize = true;
|
||||
lblCarDetails.Location = new System.Drawing.Point(3, 166);
|
||||
lblCarDetails.Name = "lblCarDetails";
|
||||
lblCarDetails.Size = new System.Drawing.Size(92, 15);
|
||||
lblCarDetails.TabIndex = 5;
|
||||
lblCarDetails.Text = "2009 - 13.000km";
|
||||
//
|
||||
// lblCarName
|
||||
//
|
||||
this.lblCarName.AutoSize = true;
|
||||
this.lblCarName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblCarName.Font = new System.Drawing.Font("Arial", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblCarName.Location = new System.Drawing.Point(3, 130);
|
||||
this.lblCarName.Name = "lblCarName";
|
||||
this.lblCarName.Size = new System.Drawing.Size(204, 44);
|
||||
this.lblCarName.TabIndex = 4;
|
||||
this.lblCarName.Text = "Skoda Fabia fdsdfsdfsdfsdf";
|
||||
this.lblCarName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
lblCarName.AutoSize = true;
|
||||
lblCarName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
lblCarName.Font = new System.Drawing.Font("Arial", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
|
||||
lblCarName.Location = new System.Drawing.Point(3, 122);
|
||||
lblCarName.Name = "lblCarName";
|
||||
lblCarName.Size = new System.Drawing.Size(178, 44);
|
||||
lblCarName.TabIndex = 4;
|
||||
lblCarName.Text = "Skoda Fabia fdsdfsdfsdfsdf";
|
||||
lblCarName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// pbxCar
|
||||
//
|
||||
this.pbxCar.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pbxCar.Image = ((System.Drawing.Image)(resources.GetObject("pbxCar.Image")));
|
||||
this.pbxCar.ImageLocation = "";
|
||||
this.pbxCar.InitialImage = ((System.Drawing.Image)(resources.GetObject("pbxCar.InitialImage")));
|
||||
this.pbxCar.Location = new System.Drawing.Point(3, 3);
|
||||
this.pbxCar.Name = "pbxCar";
|
||||
this.pbxCar.Size = new System.Drawing.Size(204, 124);
|
||||
this.pbxCar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pbxCar.TabIndex = 3;
|
||||
this.pbxCar.TabStop = false;
|
||||
pbxCar.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
pbxCar.ErrorImage = (System.Drawing.Image)resources.GetObject("pbxCar.ErrorImage");
|
||||
pbxCar.Image = (System.Drawing.Image)resources.GetObject("pbxCar.Image");
|
||||
pbxCar.ImageLocation = "";
|
||||
pbxCar.InitialImage = (System.Drawing.Image)resources.GetObject("pbxCar.InitialImage");
|
||||
pbxCar.Location = new System.Drawing.Point(3, 3);
|
||||
pbxCar.Name = "pbxCar";
|
||||
pbxCar.Size = new System.Drawing.Size(178, 116);
|
||||
pbxCar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
pbxCar.TabIndex = 3;
|
||||
pbxCar.TabStop = false;
|
||||
//
|
||||
// CarCard
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Name = "CarCard";
|
||||
this.Size = new System.Drawing.Size(210, 200);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbxCar)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
AutoSize = true;
|
||||
BackColor = System.Drawing.SystemColors.Control;
|
||||
Controls.Add(tableLayoutPanel1);
|
||||
Name = "CarCard";
|
||||
Size = new System.Drawing.Size(184, 188);
|
||||
tableLayoutPanel1.ResumeLayout(false);
|
||||
tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pbxCar).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace CarManagerV3
|
||||
|
||||
public async void LoadImage()
|
||||
{
|
||||
this.CarImage = null; // Clear current image
|
||||
this.CarImage = pbxCar.InitialImage; // Set to loading image
|
||||
await Task.Run(() =>
|
||||
{
|
||||
@@ -58,6 +59,10 @@ namespace CarManagerV3
|
||||
{
|
||||
this.CarImage = img;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.CarImage = pbxCar.ErrorImage; // Set to error image if loading fails
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
17
CarManagerV3/Forms/MainForm.Designer.cs
generated
17
CarManagerV3/Forms/MainForm.Designer.cs
generated
@@ -53,6 +53,7 @@
|
||||
openWelcomeScreenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
clearRecentFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
imageList1 = new System.Windows.Forms.ImageList(components);
|
||||
settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
tableLayoutPanel1.SuspendLayout();
|
||||
tlpControls.SuspendLayout();
|
||||
tlpSearch.SuspendLayout();
|
||||
@@ -231,7 +232,7 @@
|
||||
//
|
||||
// editToolStripMenuItem
|
||||
//
|
||||
editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { addCarToolStripMenuItem, importToolStripMenuItem, clearSearchToolStripMenuItem });
|
||||
editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { addCarToolStripMenuItem, importToolStripMenuItem, clearSearchToolStripMenuItem, settingsToolStripMenuItem });
|
||||
editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||
editToolStripMenuItem.Size = new System.Drawing.Size(49, 24);
|
||||
editToolStripMenuItem.Text = "Edit";
|
||||
@@ -239,21 +240,21 @@
|
||||
// addCarToolStripMenuItem
|
||||
//
|
||||
addCarToolStripMenuItem.Name = "addCarToolStripMenuItem";
|
||||
addCarToolStripMenuItem.Size = new System.Drawing.Size(174, 26);
|
||||
addCarToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
||||
addCarToolStripMenuItem.Text = "Add Car";
|
||||
addCarToolStripMenuItem.Click += addCarToolStripMenuItem_Click;
|
||||
//
|
||||
// importToolStripMenuItem
|
||||
//
|
||||
importToolStripMenuItem.Name = "importToolStripMenuItem";
|
||||
importToolStripMenuItem.Size = new System.Drawing.Size(174, 26);
|
||||
importToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
||||
importToolStripMenuItem.Text = "Import";
|
||||
importToolStripMenuItem.Click += importToolStripMenuItem_Click;
|
||||
//
|
||||
// clearSearchToolStripMenuItem
|
||||
//
|
||||
clearSearchToolStripMenuItem.Name = "clearSearchToolStripMenuItem";
|
||||
clearSearchToolStripMenuItem.Size = new System.Drawing.Size(174, 26);
|
||||
clearSearchToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
||||
clearSearchToolStripMenuItem.Text = "Clear Search";
|
||||
clearSearchToolStripMenuItem.Click += clearSearchToolStripMenuItem_Click;
|
||||
//
|
||||
@@ -289,6 +290,13 @@
|
||||
imageList1.Images.SetKeyName(0, "Icon_Search.png");
|
||||
imageList1.Images.SetKeyName(1, "Icon_Add.png");
|
||||
//
|
||||
// settingsToolStripMenuItem
|
||||
//
|
||||
settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
||||
settingsToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
||||
settingsToolStripMenuItem.Text = "Settings";
|
||||
settingsToolStripMenuItem.Click += settingsToolStripMenuItem_Click;
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
@@ -339,5 +347,6 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem clearRecentFilesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
@@ -13,13 +13,30 @@ namespace CarManagerV3
|
||||
List<Car> cars = new List<Car>();
|
||||
string filepath = "";
|
||||
|
||||
public MainForm()
|
||||
public static MainForm GetMainForm()
|
||||
{
|
||||
// This is a singleton pattern to ensure only one instance of MainForm exists.
|
||||
// If you need to access the MainForm instance, you can use this method.
|
||||
return Application.OpenForms.OfType<MainForm>().FirstOrDefault() ?? new MainForm();
|
||||
}
|
||||
|
||||
public MainForm(string pathToOpen = "")
|
||||
{
|
||||
InitializeComponent();
|
||||
if (Properties.Settings.Default.DataLocation == "")
|
||||
{
|
||||
Properties.Settings.Default.DataLocation = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\CarManagerV3";
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
// Open the most recent file if it exists. Otherwise, use default filepath.
|
||||
List<string> recentFiles = SafeManager.GetRecentPaths();
|
||||
if (recentFiles.Count > 0)
|
||||
if (!String.IsNullOrEmpty(pathToOpen))
|
||||
{
|
||||
filepath = pathToOpen;
|
||||
SafeManager.AddRecentPath(filepath);
|
||||
}
|
||||
else if (recentFiles.Count > 0)
|
||||
{
|
||||
filepath = recentFiles[0];
|
||||
}
|
||||
@@ -90,7 +107,7 @@ namespace CarManagerV3
|
||||
/// </summary>
|
||||
/// <param name="_cars">The cars.</param>
|
||||
/// <param name="updateGlobal">if set to <c>true</c> [update global].</param>
|
||||
private async void refreshCars(List<Car> _cars, bool updateGlobal = true)
|
||||
private async void refreshCars(List<Car> _cars, bool updateGlobal = true, bool force = false)
|
||||
{
|
||||
|
||||
this.Text = "Car Manager - " + System.IO.Path.GetFileName(filepath);
|
||||
@@ -120,12 +137,12 @@ namespace CarManagerV3
|
||||
}
|
||||
// compare details
|
||||
// Console.WriteLine($"[L] Checking car: {car.Id} | Car Color: {car.Color} | Ex Color: {existingCar.Color}");
|
||||
if (existingCar.IsChanged(car))
|
||||
if (existingCar.IsChanged(car) || force)
|
||||
{
|
||||
Console.WriteLine($"[L] Updating car: {car.Id}");
|
||||
// changes
|
||||
card = existing;
|
||||
|
||||
if(force) card.LoadImage(); // reload image if forced refresh
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -291,7 +308,7 @@ namespace CarManagerV3
|
||||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog dlgOpen = new OpenFileDialog();
|
||||
dlgOpen.Filter = "CSV Files (*.csv)|*.csv|All Files (*.*)|*.*";
|
||||
dlgOpen.Filter = "Compatible Files (*.csv;*.cars)|*.csv;*.cars|CSV Files (*.csv)|*.csv|Car Manager CSV (*.cars)|*.cars|All Files (*.*)|*.*";
|
||||
dlgOpen.Title = "Open Car Data File";
|
||||
// Default to users documents
|
||||
dlgOpen.InitialDirectory = SafeManager.getRecentFolder();
|
||||
@@ -337,7 +354,7 @@ namespace CarManagerV3
|
||||
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveFileDialog dlgSave = new SaveFileDialog();
|
||||
dlgSave.Filter = "CSV Files (*.csv)|*.csv|All Files (*.*)|*.*";
|
||||
dlgSave.Filter = "Compatible Files (*.csv;*.cars)|*.csv;*.cars|CSV Files (*.csv)|*.csv|Car Manager CSV (*.cars)|*.cars|All Files (*.*)|*.*";
|
||||
dlgSave.Title = "Save Car Data File As";
|
||||
// Default to users documents
|
||||
dlgSave.InitialDirectory = SafeManager.getRecentFolder();
|
||||
@@ -370,7 +387,7 @@ namespace CarManagerV3
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
OpenFileDialog dlgOpen = new OpenFileDialog();
|
||||
dlgOpen.Filter = "CSV Files (*.csv)|*.csv|All Files (*.*)|*.*";
|
||||
dlgOpen.Filter = "Compatible Files (*.csv;*.cars)|*.csv;*.cars|CSV Files (*.csv)|*.csv|Car Manager CSV (*.cars)|*.cars|All Files (*.*)|*.*";
|
||||
dlgOpen.Title = "Import Car Data File";
|
||||
// Default to users documents
|
||||
dlgOpen.InitialDirectory = SafeManager.getRecentFolder();
|
||||
@@ -394,7 +411,7 @@ namespace CarManagerV3
|
||||
if (mergeAsNewFileResult == DialogResult.Yes)
|
||||
{
|
||||
SaveFileDialog dlgSave = new SaveFileDialog();
|
||||
dlgSave.Filter = "CSV Files (*.csv)|*.csv|All Files (*.*)|*.*";
|
||||
dlgSave.Filter = "Compatible Files (*.csv;*.cars)|*.csv;*.cars|CSV Files (*.csv)|*.csv|Car Manager CSV (*.cars)|*.cars|All Files (*.*)|*.*";
|
||||
dlgSave.Title = "Save Merged Car Data File As";
|
||||
// Default to users documents
|
||||
dlgSave.InitialDirectory = SafeManager.getRecentFolder();
|
||||
@@ -519,5 +536,19 @@ namespace CarManagerV3
|
||||
{
|
||||
SafeManager.ClearRecentPaths();
|
||||
}
|
||||
|
||||
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SettingsForm settingsForm = new SettingsForm();
|
||||
settingsForm.FormClosed += (s2, e2) =>
|
||||
{
|
||||
// refresh cars in case data location changed
|
||||
List<Car> cars_ = SafeManager.ReadCars(filepath);
|
||||
refreshCars(cars_, false, true);
|
||||
System.Diagnostics.Debug.WriteLine("Refreshed!");
|
||||
};
|
||||
settingsForm.ShowDialog();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,15 +150,15 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
|
||||
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
|
||||
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAYAQAAAJNU0Z0AUkBTAIBAQIB
|
||||
AAGAAQABgAEAARQBAAEUAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABUAMAARQDAAEBAQABIAYAARn/
|
||||
AAGIAQABiAEAARQBAAEUAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABUAMAARQDAAEBAQABIAYAARn/
|
||||
AP8AzAADCAEKAyMBMgMuAUYDFgEe/wAtAAMIAQoDIwEyAk8BTgGXAlYBVAGrAy4BRv8ALQADIwEyAk8B
|
||||
TgGXAf8BmQEzAf8DTgGWAyMBMiwAA10BzAT/9AADKAE8Ak8BTgGXAl8BWwHTA04BlgMjATIDCAEKLAAD
|
||||
XQHMBP/UAAMDAQQDDwETA0QBewJPAU4BlwNNAZIDQAFuAwYBBwMpAT0DTgGYAlsBWQHAAk8BTgGXAyMB
|
||||
MgMIAQowAANdAcwE/9AAAxMBGgMxAU0DRAF5AlwBWQHBAmEBXQHPAl0BWwHKAlcBVQG0Az8BbQNSAaMC
|
||||
WwFZAcADTgGYAygBPDgAA10BzAT/zAADAwEEAzEBTQJZAVcBvAJgAV0BzgNLAYwDQAFvA0ABbwNLAYwC
|
||||
YAFdAc4BhgFzAVMB9AJTAVEBogMpAT08AANdAcwE/8wAAw8BEwNEAXkCYAFdAc4DBgEIBAIIAAQCAwYB
|
||||
YAFdAc4BggFxAVMB9AJTAVEBogMpAT08AANdAcwE/8wAAw8BEwNEAXkCYAFdAc4DBgEIBAIIAAQCAwYB
|
||||
CAJgAV0BzgM+AWsDBAEFKAADXQHMLP+4AANEAXkDWgG/A0sBjAQCEAAEAgNLAYwCWgFYAbcDQQFxKAAD
|
||||
UgGjA10BzANdAcwDXQHMA10BzAOOAfUE/wNdAcwDXQHMA10BzANdAcwDXQHMuAACTwFOAZcCYAFdAc4D
|
||||
UgGjA10BzANdAcwDXQHMA10BzAOJAfUE/wNdAcwDXQHMA10BzANdAcwDXQHMuAACTwFOAZcCYAFdAc4D
|
||||
QAFvGAADQAFvAl8BXAHLA04BlDwAA10BzAT/zAACTwFOAZcCYAFdAc4DQAFvGAADQAFvAl4BWwHNA04B
|
||||
ljwAA10BzAT/zAADRAF6AlsBWQHAA0sBjAQCEAAEAgNLAYwCWgFYAb0CRAFDAXc8AANdAcwE/8wAAw4B
|
||||
EgNEAXgCYAFdAc4DBgEIBAIIAAQCAwYBCAJgAV0BzgJDAUIBdQMMAQ88AANdAcwE/8wAAwMBBAMxAU0C
|
||||
|
||||
182
CarManagerV3/Forms/NetCredentials.Designer.cs
generated
Normal file
182
CarManagerV3/Forms/NetCredentials.Designer.cs
generated
Normal file
@@ -0,0 +1,182 @@
|
||||
namespace CarManagerV3.Forms
|
||||
{
|
||||
partial class NetCredentials
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
tbxUsername = new System.Windows.Forms.TextBox();
|
||||
label4 = new System.Windows.Forms.Label();
|
||||
tbxPassword = new System.Windows.Forms.TextBox();
|
||||
flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
btnAccept = new System.Windows.Forms.Button();
|
||||
btnCancel = new System.Windows.Forms.Button();
|
||||
flowLayoutPanel1.SuspendLayout();
|
||||
flowLayoutPanel2.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
flowLayoutPanel1.Controls.Add(label1);
|
||||
flowLayoutPanel1.Controls.Add(label2);
|
||||
flowLayoutPanel1.Controls.Add(label3);
|
||||
flowLayoutPanel1.Controls.Add(tbxUsername);
|
||||
flowLayoutPanel1.Controls.Add(label4);
|
||||
flowLayoutPanel1.Controls.Add(tbxPassword);
|
||||
flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(10);
|
||||
flowLayoutPanel1.Size = new System.Drawing.Size(349, 248);
|
||||
flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new System.Drawing.Font("Segoe UI", 14F);
|
||||
label1.Location = new System.Drawing.Point(13, 10);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(232, 25);
|
||||
label1.TabIndex = 0;
|
||||
label1.Text = "Enter Network Credentials";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new System.Drawing.Point(13, 35);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(308, 30);
|
||||
label2.TabIndex = 1;
|
||||
label2.Text = "Your network requires credentials to access data through the proxy";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new System.Drawing.Point(13, 85);
|
||||
label3.Margin = new System.Windows.Forms.Padding(3, 20, 3, 0);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(86, 15);
|
||||
label3.TabIndex = 2;
|
||||
label3.Text = "Your username";
|
||||
//
|
||||
// tbxUsername
|
||||
//
|
||||
tbxUsername.Location = new System.Drawing.Point(13, 103);
|
||||
tbxUsername.Name = "tbxUsername";
|
||||
tbxUsername.Size = new System.Drawing.Size(308, 23);
|
||||
tbxUsername.TabIndex = 3;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new System.Drawing.Point(13, 139);
|
||||
label4.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new System.Drawing.Size(84, 15);
|
||||
label4.TabIndex = 4;
|
||||
label4.Text = "Your password";
|
||||
//
|
||||
// tbxPassword
|
||||
//
|
||||
tbxPassword.Location = new System.Drawing.Point(13, 157);
|
||||
tbxPassword.Name = "tbxPassword";
|
||||
tbxPassword.PasswordChar = '*';
|
||||
tbxPassword.Size = new System.Drawing.Size(308, 23);
|
||||
tbxPassword.TabIndex = 5;
|
||||
//
|
||||
// flowLayoutPanel2
|
||||
//
|
||||
flowLayoutPanel2.Controls.Add(btnAccept);
|
||||
flowLayoutPanel2.Controls.Add(btnCancel);
|
||||
flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
flowLayoutPanel2.Location = new System.Drawing.Point(0, 198);
|
||||
flowLayoutPanel2.Name = "flowLayoutPanel2";
|
||||
flowLayoutPanel2.Size = new System.Drawing.Size(349, 50);
|
||||
flowLayoutPanel2.TabIndex = 1;
|
||||
//
|
||||
// btnAccept
|
||||
//
|
||||
btnAccept.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnAccept.Location = new System.Drawing.Point(271, 3);
|
||||
btnAccept.Name = "btnAccept";
|
||||
btnAccept.Size = new System.Drawing.Size(75, 23);
|
||||
btnAccept.TabIndex = 0;
|
||||
btnAccept.Text = "Save";
|
||||
btnAccept.UseVisualStyleBackColor = true;
|
||||
btnAccept.Click += btnAccept_Click;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
btnCancel.Location = new System.Drawing.Point(190, 3);
|
||||
btnCancel.Name = "btnCancel";
|
||||
btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
btnCancel.TabIndex = 1;
|
||||
btnCancel.Text = "Cancel";
|
||||
btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// NetCredentials
|
||||
//
|
||||
AcceptButton = btnAccept;
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
CancelButton = btnCancel;
|
||||
ClientSize = new System.Drawing.Size(349, 248);
|
||||
ControlBox = false;
|
||||
Controls.Add(flowLayoutPanel2);
|
||||
Controls.Add(flowLayoutPanel1);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
MaximizeBox = false;
|
||||
Name = "NetCredentials";
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
Text = "Enter Network Credentials";
|
||||
TopMost = true;
|
||||
Load += NetCredentials_Load;
|
||||
flowLayoutPanel1.ResumeLayout(false);
|
||||
flowLayoutPanel1.PerformLayout();
|
||||
flowLayoutPanel2.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox tbxUsername;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox tbxPassword;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
|
||||
private System.Windows.Forms.Button btnAccept;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
}
|
||||
}
|
||||
38
CarManagerV3/Forms/NetCredentials.cs
Normal file
38
CarManagerV3/Forms/NetCredentials.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CarManagerV3.Forms
|
||||
{
|
||||
public partial class NetCredentials : Form
|
||||
{
|
||||
public NetCredentials()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public NetworkCredential GetCredentails()
|
||||
{
|
||||
return new NetworkCredential(tbxUsername.Text, tbxPassword.Text);
|
||||
}
|
||||
|
||||
private void NetCredentials_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.BringToFront();
|
||||
this.Focus();
|
||||
}
|
||||
|
||||
private void btnAccept_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CarManagerV3/Forms/NetCredentials.resx
Normal file
120
CarManagerV3/Forms/NetCredentials.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
218
CarManagerV3/Forms/SettingsForm.Designer.cs
generated
Normal file
218
CarManagerV3/Forms/SettingsForm.Designer.cs
generated
Normal file
@@ -0,0 +1,218 @@
|
||||
namespace CarManagerV3.Forms
|
||||
{
|
||||
partial class SettingsForm
|
||||
{
|
||||
/// <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(SettingsForm));
|
||||
flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
btnAccept = new System.Windows.Forms.Button();
|
||||
btnDiscard = new System.Windows.Forms.Button();
|
||||
tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
lblDataLocation = new System.Windows.Forms.Label();
|
||||
tbxDataLocation = new System.Windows.Forms.TextBox();
|
||||
tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
btnReset = new System.Windows.Forms.Button();
|
||||
flowLayoutPanel1.SuspendLayout();
|
||||
flowLayoutPanel2.SuspendLayout();
|
||||
tableLayoutPanel1.SuspendLayout();
|
||||
tableLayoutPanel2.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
flowLayoutPanel1.Controls.Add(label1);
|
||||
flowLayoutPanel1.Controls.Add(label2);
|
||||
flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(11, 13, 11, 13);
|
||||
flowLayoutPanel1.Size = new System.Drawing.Size(499, 86);
|
||||
flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new System.Drawing.Font("Segoe UI", 14F);
|
||||
label1.Location = new System.Drawing.Point(14, 13);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(100, 32);
|
||||
label1.TabIndex = 2;
|
||||
label1.Text = "Settings";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new System.Drawing.Point(14, 45);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(276, 20);
|
||||
label2.TabIndex = 3;
|
||||
label2.Text = "Adjust settings related to Car Manager 3";
|
||||
//
|
||||
// flowLayoutPanel2
|
||||
//
|
||||
flowLayoutPanel2.Controls.Add(btnAccept);
|
||||
flowLayoutPanel2.Controls.Add(btnDiscard);
|
||||
flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
|
||||
flowLayoutPanel2.Location = new System.Drawing.Point(249, 0);
|
||||
flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
|
||||
flowLayoutPanel2.Name = "flowLayoutPanel2";
|
||||
flowLayoutPanel2.Size = new System.Drawing.Size(240, 64);
|
||||
flowLayoutPanel2.TabIndex = 2;
|
||||
//
|
||||
// btnAccept
|
||||
//
|
||||
btnAccept.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnAccept.Location = new System.Drawing.Point(151, 4);
|
||||
btnAccept.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
btnAccept.Name = "btnAccept";
|
||||
btnAccept.Size = new System.Drawing.Size(86, 31);
|
||||
btnAccept.TabIndex = 0;
|
||||
btnAccept.Text = "Save";
|
||||
btnAccept.UseVisualStyleBackColor = true;
|
||||
btnAccept.Click += btnAccept_Click;
|
||||
//
|
||||
// btnDiscard
|
||||
//
|
||||
btnDiscard.Location = new System.Drawing.Point(59, 4);
|
||||
btnDiscard.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
btnDiscard.Name = "btnDiscard";
|
||||
btnDiscard.Size = new System.Drawing.Size(86, 31);
|
||||
btnDiscard.TabIndex = 1;
|
||||
btnDiscard.Text = "Discard";
|
||||
btnDiscard.UseVisualStyleBackColor = true;
|
||||
btnDiscard.Click += btnDiscard_Click;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
tableLayoutPanel1.ColumnCount = 2;
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
tableLayoutPanel1.Controls.Add(lblDataLocation, 0, 0);
|
||||
tableLayoutPanel1.Controls.Add(tbxDataLocation, 1, 0);
|
||||
tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel1.Location = new System.Drawing.Point(0, 86);
|
||||
tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(10, 0, 10, 0);
|
||||
tableLayoutPanel1.RowCount = 2;
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
tableLayoutPanel1.Size = new System.Drawing.Size(499, 531);
|
||||
tableLayoutPanel1.TabIndex = 3;
|
||||
//
|
||||
// lblDataLocation
|
||||
//
|
||||
lblDataLocation.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
lblDataLocation.AutoSize = true;
|
||||
lblDataLocation.Location = new System.Drawing.Point(13, 6);
|
||||
lblDataLocation.Name = "lblDataLocation";
|
||||
lblDataLocation.Size = new System.Drawing.Size(102, 20);
|
||||
lblDataLocation.TabIndex = 0;
|
||||
lblDataLocation.Text = "Data Location";
|
||||
lblDataLocation.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// tbxDataLocation
|
||||
//
|
||||
tbxDataLocation.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tbxDataLocation.Location = new System.Drawing.Point(121, 3);
|
||||
tbxDataLocation.Name = "tbxDataLocation";
|
||||
tbxDataLocation.Size = new System.Drawing.Size(365, 27);
|
||||
tbxDataLocation.TabIndex = 1;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
tableLayoutPanel2.ColumnCount = 2;
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
tableLayoutPanel2.Controls.Add(flowLayoutPanel2, 1, 0);
|
||||
tableLayoutPanel2.Controls.Add(btnReset, 0, 0);
|
||||
tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
tableLayoutPanel2.Location = new System.Drawing.Point(0, 553);
|
||||
tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||
tableLayoutPanel2.Padding = new System.Windows.Forms.Padding(10, 0, 10, 0);
|
||||
tableLayoutPanel2.RowCount = 1;
|
||||
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
tableLayoutPanel2.Size = new System.Drawing.Size(499, 64);
|
||||
tableLayoutPanel2.TabIndex = 4;
|
||||
//
|
||||
// btnReset
|
||||
//
|
||||
btnReset.AutoSize = true;
|
||||
btnReset.Location = new System.Drawing.Point(13, 3);
|
||||
btnReset.Name = "btnReset";
|
||||
btnReset.Size = new System.Drawing.Size(130, 30);
|
||||
btnReset.TabIndex = 3;
|
||||
btnReset.Text = "Revert to default";
|
||||
btnReset.UseVisualStyleBackColor = true;
|
||||
btnReset.Click += btnReset_Click;
|
||||
//
|
||||
// SettingsForm
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
ClientSize = new System.Drawing.Size(499, 617);
|
||||
Controls.Add(tableLayoutPanel2);
|
||||
Controls.Add(tableLayoutPanel1);
|
||||
Controls.Add(flowLayoutPanel1);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
|
||||
MaximizeBox = false;
|
||||
MinimizeBox = false;
|
||||
Name = "SettingsForm";
|
||||
Text = "Settings";
|
||||
TopMost = true;
|
||||
Load += SettingsForm_Load;
|
||||
flowLayoutPanel1.ResumeLayout(false);
|
||||
flowLayoutPanel1.PerformLayout();
|
||||
flowLayoutPanel2.ResumeLayout(false);
|
||||
tableLayoutPanel1.ResumeLayout(false);
|
||||
tableLayoutPanel1.PerformLayout();
|
||||
tableLayoutPanel2.ResumeLayout(false);
|
||||
tableLayoutPanel2.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
|
||||
private System.Windows.Forms.Button btnAccept;
|
||||
private System.Windows.Forms.Button btnDiscard;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label lblDataLocation;
|
||||
private System.Windows.Forms.TextBox tbxDataLocation;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.Button btnReset;
|
||||
}
|
||||
}
|
||||
107
CarManagerV3/Forms/SettingsForm.cs
Normal file
107
CarManagerV3/Forms/SettingsForm.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
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 SettingsForm : Form
|
||||
{
|
||||
// Settings map (Maps settings to controls and default values + optional change event handler function that takes previous and new value)
|
||||
private Dictionary<string, (Control control, string defaultValue, Action<string, string> onChange)> settingsMap = new Dictionary<string, (Control control, string defaultValue, Action<string, string> onChange)>();
|
||||
|
||||
public SettingsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
initializeSettingsMap();
|
||||
}
|
||||
|
||||
private void initializeSettingsMap()
|
||||
{
|
||||
// Initialize the settings map with setting keys, associated controls, default values, and optional change event handlers
|
||||
settingsMap["DataLocation"] = (tbxDataLocation, Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\CarManagerV3", (string before, string after) =>
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
private void SettingsForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
private void loadSettings()
|
||||
{
|
||||
// with settings map
|
||||
foreach (var setting in settingsMap)
|
||||
{
|
||||
string key = setting.Key;
|
||||
Control control = setting.Value.control;
|
||||
string value = Properties.Settings.Default[key]?.ToString() ?? string.Empty;
|
||||
control.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void saveSettings()
|
||||
{
|
||||
// Save settings using the settings map
|
||||
foreach (var setting in settingsMap)
|
||||
{
|
||||
string key = setting.Key;
|
||||
Control control = setting.Value.control;
|
||||
string value = control.Text;
|
||||
string oldValue = Properties.Settings.Default[key]?.ToString() ?? string.Empty;
|
||||
// Save the value to application settings
|
||||
Properties.Settings.Default[key] = value;
|
||||
// Invoke the change event handler if it exists and the value has changed
|
||||
if (setting.Value.onChange != null && oldValue != value)
|
||||
{
|
||||
setting.Value.onChange(oldValue, value);
|
||||
}
|
||||
}
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private void resetSettings()
|
||||
{
|
||||
DialogResult confirmReset = MessageBox.Show("Are you sure you want to reset all settings to their default values? This action cannot be undone.", "Confirm Reset", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||
if(confirmReset != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Reset settings to default values using the settings map
|
||||
foreach (var setting in settingsMap)
|
||||
{
|
||||
string key = setting.Key;
|
||||
string defaultValue = setting.Value.defaultValue;
|
||||
// Reset the value to default in application settings
|
||||
Properties.Settings.Default[key] = defaultValue;
|
||||
}
|
||||
Properties.Settings.Default.Save();
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
private void btnAccept_Click(object sender, EventArgs e)
|
||||
{
|
||||
saveSettings();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnDiscard_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
4636
CarManagerV3/Forms/SettingsForm.resx
Normal file
4636
CarManagerV3/Forms/SettingsForm.resx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,8 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Net;
|
||||
using System.Windows.Forms;
|
||||
using CarManagerV3.Forms;
|
||||
|
||||
namespace CarManagerV3
|
||||
{
|
||||
@@ -9,13 +12,16 @@ namespace CarManagerV3
|
||||
internal class ImageManager
|
||||
{
|
||||
|
||||
private static string _imagePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\CarManagerV3\\images";
|
||||
private static string _imagePath = Properties.Settings.Default.DataLocation + "\\images";
|
||||
private static NetworkCredential myNetCred = null;
|
||||
private static bool disableImageFetch = false;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the image folder by creating it if it does not exist.
|
||||
/// </summary>
|
||||
public static void InitializeImageFolder()
|
||||
{
|
||||
_imagePath = Properties.Settings.Default.DataLocation + "\\images";
|
||||
string path = _imagePath;
|
||||
|
||||
if (!System.IO.Directory.Exists(path))
|
||||
@@ -34,6 +40,7 @@ namespace CarManagerV3
|
||||
/// <returns>The image path for this Car.</returns>
|
||||
public static string GetImagePath(Car car)
|
||||
{
|
||||
_imagePath = Properties.Settings.Default.DataLocation + "\\images";
|
||||
string basePath = $"{_imagePath}/";
|
||||
string fileName = $"{car.Make}_{car.Model}_{car.Year}_{car.Color}.png";
|
||||
return basePath + fileName;
|
||||
@@ -88,17 +95,63 @@ namespace CarManagerV3
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (disableImageFetch) return;
|
||||
string url = $"https://cdn.imagin.studio/getimage?customer=hrjavascript-mastery&zoomType=fullscreen&make={car.Make}&modelFamily={car.Model}&modelYear={car.Year}&angle=front&paintDescription={car.Color}&fileType=png";
|
||||
//add Referer header to avoid 403 error
|
||||
using (var client = new System.Net.WebClient())
|
||||
{
|
||||
client.Headers.Add("Referer", "http://localhost");
|
||||
|
||||
try
|
||||
{
|
||||
client.Credentials = myNetCred;
|
||||
client.Proxy.Credentials = myNetCred;
|
||||
//DEBUG:: if (myNetCred == null) throw new WebException();
|
||||
client.DownloadFile(url, path);
|
||||
}
|
||||
catch
|
||||
catch (WebException ex)
|
||||
{
|
||||
// is status code 407?
|
||||
//if (ex.Response is HttpWebResponse response && response.StatusCode == HttpStatusCode.ProxyAuthenticationRequired)
|
||||
//{
|
||||
// Console.Error.WriteLine("Proxy authentication required. Prompting for credentials.");
|
||||
//}
|
||||
|
||||
if (myNetCred != null)
|
||||
{
|
||||
DialogResult disableImgDialogRetry = MessageBox.Show("Something went wrong when fetching images. Are you credentials correct? Do you want to disable Image fetching for this session or rety with different credentials?", "Invalid Credentials", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
|
||||
if(disableImgDialogRetry == DialogResult.Cancel)
|
||||
{
|
||||
disableImageFetch = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
NetCredentials netCredForm = new NetCredentials();
|
||||
DialogResult dialogRes = netCredForm.ShowDialog();
|
||||
netCredForm.BringToFront();
|
||||
netCredForm.Focus();
|
||||
if (dialogRes == DialogResult.OK)
|
||||
{
|
||||
NetworkCredential netcred = netCredForm.GetCredentails();
|
||||
myNetCred = netcred;
|
||||
FetchImage(car);
|
||||
return;
|
||||
} else
|
||||
{
|
||||
DialogResult disableImgDialog = MessageBox.Show("Do you want to disable image fetching for this session?", "Disable Image fetching?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
if(disableImgDialog == DialogResult.Yes)
|
||||
{
|
||||
disableImageFetch = true;
|
||||
} else
|
||||
{
|
||||
FetchImage(car);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Error.WriteLine(ex.Message);
|
||||
// if error, use fallback image no_image_available.png
|
||||
//System.IO.File.Copy($"{_imagePath}/no_image_available.png", path);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CarManagerV3
|
||||
/// <summary>
|
||||
/// The path of the txt file that contains recently opened file paths.
|
||||
/// </summary>
|
||||
private static readonly string recentPathsFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\CarManagerV3\\recent_paths.txt";
|
||||
private static string recentPathsFile = Properties.Settings.Default.DataLocation + "\\recent_paths.txt";
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -46,16 +46,17 @@ namespace CarManagerV3
|
||||
/// 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)
|
||||
public static void initializeFileAndFolders(string path, bool folderOnly = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
string directory = Path.GetDirectoryName(path);
|
||||
if (!Directory.Exists(directory))
|
||||
//string directory = Path.GetDirectoryName(path);
|
||||
Console.WriteLine($"Initializing file and folders for path: {path}");
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(directory);
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
InitializeFile(path);
|
||||
if(!folderOnly) InitializeFile(path);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -204,6 +205,7 @@ namespace CarManagerV3
|
||||
List<string> paths = new List<string>();
|
||||
try
|
||||
{
|
||||
recentPathsFile = Properties.Settings.Default.DataLocation + "\\recent_paths.txt";
|
||||
initializeFileAndFolders(recentPathsFile);
|
||||
if (File.Exists(recentPathsFile)) //TODO: Remove
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CarManagerV3
|
||||
@@ -9,11 +10,13 @@ namespace CarManagerV3
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string pathToOpen = null;
|
||||
if (args.Length > 0) pathToOpen = args[0];
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
Application.Run(new MainForm(pathToOpen));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
12
CarManagerV3/Properties/Settings.Designer.cs
generated
12
CarManagerV3/Properties/Settings.Designer.cs
generated
@@ -22,5 +22,17 @@ namespace CarManagerV3.Properties {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string DataLocation {
|
||||
get {
|
||||
return ((string)(this["DataLocation"]));
|
||||
}
|
||||
set {
|
||||
this["DataLocation"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="CarManagerV3.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="DataLocation" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
7
CarManagerV3/Properties/launchSettings.json
Normal file
7
CarManagerV3/Properties/launchSettings.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"profiles": {
|
||||
"CarManagerV3": {
|
||||
"commandName": "Project"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user