From 9128e2ae93eb23fd6b8467e3b27792e129c063ad Mon Sep 17 00:00:00 2001
From: abazov73 <92822431+abazov73@users.noreply.github.com>
Date: Fri, 1 Dec 2023 11:37:40 +0400
Subject: [PATCH] Additional fixes
---
AbazovApp/AbazovAppView/AbazovAppView.csproj | 1 +
.../AbazovViewComponents.csproj | 1 +
.../Components/AbazovCheckedListBox.cs | 5 +
.../Components/AbazovTreeView.cs | 8 +-
.../AccountAppPlugins/FormMain.Designer.cs | 180 +++++++++---------
AbazovApp/AccountAppPlugins/FormMain.cs | 5 +
6 files changed, 113 insertions(+), 87 deletions(-)
diff --git a/AbazovApp/AbazovAppView/AbazovAppView.csproj b/AbazovApp/AbazovAppView/AbazovAppView.csproj
index 98fad8c..9305405 100644
--- a/AbazovApp/AbazovAppView/AbazovAppView.csproj
+++ b/AbazovApp/AbazovAppView/AbazovAppView.csproj
@@ -6,6 +6,7 @@
enable
true
enable
+ $(VersionPrefix)
diff --git a/AbazovApp/AbazovViewComponents/AbazovViewComponents.csproj b/AbazovApp/AbazovViewComponents/AbazovViewComponents.csproj
index 6880b53..b7f986d 100644
--- a/AbazovApp/AbazovViewComponents/AbazovViewComponents.csproj
+++ b/AbazovApp/AbazovViewComponents/AbazovViewComponents.csproj
@@ -6,6 +6,7 @@
true
enable
True
+ 5.0.0
diff --git a/AbazovApp/AbazovViewComponents/Components/AbazovCheckedListBox.cs b/AbazovApp/AbazovViewComponents/Components/AbazovCheckedListBox.cs
index 0b5e086..830436d 100644
--- a/AbazovApp/AbazovViewComponents/Components/AbazovCheckedListBox.cs
+++ b/AbazovApp/AbazovViewComponents/Components/AbazovCheckedListBox.cs
@@ -46,6 +46,11 @@ namespace AbazovViewComponents.Components
private void checkedListBox_SelectedIndexChanged(object sender, EventArgs e)
{
+ for (int i = 0; i < checkedListBox.Items.Count; i++)
+ {
+ checkedListBox.SetItemChecked(i, false);
+ }
+ checkedListBox.SetItemChecked(checkedListBox.SelectedIndex, true);
SelectedItemChange?.Invoke(checkedListBox.SelectedItem.ToString());
}
}
diff --git a/AbazovApp/AbazovViewComponents/Components/AbazovTreeView.cs b/AbazovApp/AbazovViewComponents/Components/AbazovTreeView.cs
index 8c0c25f..b5685c0 100644
--- a/AbazovApp/AbazovViewComponents/Components/AbazovTreeView.cs
+++ b/AbazovApp/AbazovViewComponents/Components/AbazovTreeView.cs
@@ -47,7 +47,8 @@ namespace AbazovViewComponents.Components
var property = properties.FirstOrDefault(x => x.Name == node.Name);
if (property != null)
{
- property.SetValue(item, node.Text);
+ Type typeOfField = property.PropertyType;
+ property.SetValue(item, Convert.ChangeType(node.Text, typeOfField));
}
node = node.Parent;
}
@@ -86,5 +87,10 @@ namespace AbazovViewComponents.Components
}
}
}
+
+ public void clear()
+ {
+ treeView.Nodes.Clear();
+ }
}
}
diff --git a/AbazovApp/AccountAppPlugins/FormMain.Designer.cs b/AbazovApp/AccountAppPlugins/FormMain.Designer.cs
index ade69db..4d5081b 100644
--- a/AbazovApp/AccountAppPlugins/FormMain.Designer.cs
+++ b/AbazovApp/AccountAppPlugins/FormMain.Designer.cs
@@ -31,131 +31,139 @@ namespace AccountAppPlugins
///
private void InitializeComponent()
{
- menuStrip = new MenuStrip();
- ControlsStripMenuItem = new ToolStripMenuItem();
- ActionsToolStripMenuItem = new ToolStripMenuItem();
- ThesaurusToolStripMenuItem = new ToolStripMenuItem();
- AddElementToolStripMenuItem = new ToolStripMenuItem();
- UpdElementToolStripMenuItem = new ToolStripMenuItem();
- DelElementToolStripMenuItem = new ToolStripMenuItem();
- DocsToolStripMenuItem = new ToolStripMenuItem();
- SimpleDocToolStripMenuItem = new ToolStripMenuItem();
- TableDocToolStripMenuItem = new ToolStripMenuItem();
- ChartDocToolStripMenuItem = new ToolStripMenuItem();
- panelControl = new Panel();
- menuStrip.SuspendLayout();
- SuspendLayout();
+ this.menuStrip = new System.Windows.Forms.MenuStrip();
+ this.ControlsStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.ActionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.ThesaurusToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.AddElementToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.UpdElementToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.DelElementToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.DocsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.SimpleDocToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.TableDocToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.ChartDocToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.panelControl = new System.Windows.Forms.Panel();
+ this.menuStrip.SuspendLayout();
+ this.SuspendLayout();
//
// menuStrip
//
- menuStrip.Items.AddRange(new ToolStripItem[] { ControlsStripMenuItem, ActionsToolStripMenuItem, DocsToolStripMenuItem });
- menuStrip.Location = new Point(0, 0);
- menuStrip.Name = "menuStrip";
- menuStrip.Size = new Size(800, 24);
- menuStrip.TabIndex = 0;
- menuStrip.Text = "Меню";
+ this.menuStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
+ this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.ControlsStripMenuItem,
+ this.ActionsToolStripMenuItem,
+ this.DocsToolStripMenuItem});
+ this.menuStrip.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip.Name = "menuStrip";
+ this.menuStrip.Padding = new System.Windows.Forms.Padding(7, 3, 0, 3);
+ this.menuStrip.Size = new System.Drawing.Size(914, 30);
+ this.menuStrip.TabIndex = 0;
+ this.menuStrip.Text = "Меню";
//
// ControlsStripMenuItem
//
- ControlsStripMenuItem.Name = "ControlsStripMenuItem";
- ControlsStripMenuItem.Size = new Size(90, 20);
- ControlsStripMenuItem.Text = "Компоненты";
+ this.ControlsStripMenuItem.Name = "ControlsStripMenuItem";
+ this.ControlsStripMenuItem.Size = new System.Drawing.Size(113, 24);
+ this.ControlsStripMenuItem.Text = "Компоненты";
//
// ActionsToolStripMenuItem
//
- ActionsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ThesaurusToolStripMenuItem, AddElementToolStripMenuItem, UpdElementToolStripMenuItem, DelElementToolStripMenuItem });
- ActionsToolStripMenuItem.Name = "ActionsToolStripMenuItem";
- ActionsToolStripMenuItem.Size = new Size(70, 20);
- ActionsToolStripMenuItem.Text = "Действия";
+ this.ActionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.ThesaurusToolStripMenuItem,
+ this.AddElementToolStripMenuItem,
+ this.UpdElementToolStripMenuItem,
+ this.DelElementToolStripMenuItem});
+ this.ActionsToolStripMenuItem.Name = "ActionsToolStripMenuItem";
+ this.ActionsToolStripMenuItem.Size = new System.Drawing.Size(88, 24);
+ this.ActionsToolStripMenuItem.Text = "Действия";
//
// ThesaurusToolStripMenuItem
//
- ThesaurusToolStripMenuItem.Name = "ThesaurusToolStripMenuItem";
- ThesaurusToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.I;
- ThesaurusToolStripMenuItem.Size = new Size(180, 22);
- ThesaurusToolStripMenuItem.Text = "Справочник";
- ThesaurusToolStripMenuItem.Click += ThesaurusToolStripMenuItem_Click;
+ this.ThesaurusToolStripMenuItem.Name = "ThesaurusToolStripMenuItem";
+ this.ThesaurusToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
+ this.ThesaurusToolStripMenuItem.Size = new System.Drawing.Size(223, 26);
+ this.ThesaurusToolStripMenuItem.Text = "Справочник";
//
// AddElementToolStripMenuItem
//
- AddElementToolStripMenuItem.Name = "AddElementToolStripMenuItem";
- AddElementToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.A;
- AddElementToolStripMenuItem.Size = new Size(180, 22);
- AddElementToolStripMenuItem.Text = "Добавить";
- AddElementToolStripMenuItem.Click += AddElementToolStripMenuItem_Click;
+ this.AddElementToolStripMenuItem.Name = "AddElementToolStripMenuItem";
+ this.AddElementToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
+ this.AddElementToolStripMenuItem.Size = new System.Drawing.Size(223, 26);
+ this.AddElementToolStripMenuItem.Text = "Добавить";
//
// UpdElementToolStripMenuItem
//
- UpdElementToolStripMenuItem.Name = "UpdElementToolStripMenuItem";
- UpdElementToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.U;
- UpdElementToolStripMenuItem.Size = new Size(180, 22);
- UpdElementToolStripMenuItem.Text = "Изменить";
- UpdElementToolStripMenuItem.Click += UpdElementToolStripMenuItem_Click;
+ this.UpdElementToolStripMenuItem.Name = "UpdElementToolStripMenuItem";
+ this.UpdElementToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U)));
+ this.UpdElementToolStripMenuItem.Size = new System.Drawing.Size(223, 26);
+ this.UpdElementToolStripMenuItem.Text = "Изменить";
//
// DelElementToolStripMenuItem
//
- DelElementToolStripMenuItem.Name = "DelElementToolStripMenuItem";
- DelElementToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.D;
- DelElementToolStripMenuItem.Size = new Size(180, 22);
- DelElementToolStripMenuItem.Text = "Удалить";
- DelElementToolStripMenuItem.Click += DelElementToolStripMenuItem_Click;
+ this.DelElementToolStripMenuItem.Name = "DelElementToolStripMenuItem";
+ this.DelElementToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D)));
+ this.DelElementToolStripMenuItem.Size = new System.Drawing.Size(223, 26);
+ this.DelElementToolStripMenuItem.Text = "Удалить";
//
// DocsToolStripMenuItem
//
- DocsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { SimpleDocToolStripMenuItem, TableDocToolStripMenuItem, ChartDocToolStripMenuItem });
- DocsToolStripMenuItem.Name = "DocsToolStripMenuItem";
- DocsToolStripMenuItem.Size = new Size(82, 20);
- DocsToolStripMenuItem.Text = "Документы";
+ this.DocsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.SimpleDocToolStripMenuItem,
+ this.TableDocToolStripMenuItem,
+ this.ChartDocToolStripMenuItem});
+ this.DocsToolStripMenuItem.Name = "DocsToolStripMenuItem";
+ this.DocsToolStripMenuItem.Size = new System.Drawing.Size(101, 24);
+ this.DocsToolStripMenuItem.Text = "Документы";
//
// SimpleDocToolStripMenuItem
//
- SimpleDocToolStripMenuItem.Name = "SimpleDocToolStripMenuItem";
- SimpleDocToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.S;
- SimpleDocToolStripMenuItem.Size = new Size(233, 22);
- SimpleDocToolStripMenuItem.Text = "Простой документ";
- SimpleDocToolStripMenuItem.Click += SimpleDocToolStripMenuItem_Click;
+ this.SimpleDocToolStripMenuItem.Name = "SimpleDocToolStripMenuItem";
+ this.SimpleDocToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
+ this.SimpleDocToolStripMenuItem.Size = new System.Drawing.Size(313, 26);
+ this.SimpleDocToolStripMenuItem.Text = "Простой документ";
//
// TableDocToolStripMenuItem
//
- TableDocToolStripMenuItem.Name = "TableDocToolStripMenuItem";
- TableDocToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.T;
- TableDocToolStripMenuItem.Size = new Size(233, 22);
- TableDocToolStripMenuItem.Text = "Документ с таблицой";
- TableDocToolStripMenuItem.Click += TableDocToolStripMenuItem_Click;
+ this.TableDocToolStripMenuItem.Name = "TableDocToolStripMenuItem";
+ this.TableDocToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
+ this.TableDocToolStripMenuItem.Size = new System.Drawing.Size(313, 26);
+ this.TableDocToolStripMenuItem.Text = "Документ с таблицой";
//
// ChartDocToolStripMenuItem
//
- ChartDocToolStripMenuItem.Name = "ChartDocToolStripMenuItem";
- ChartDocToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.C;
- ChartDocToolStripMenuItem.Size = new Size(233, 22);
- ChartDocToolStripMenuItem.Text = "Документ с диаграммой";
- ChartDocToolStripMenuItem.Click += ChartDocToolStripMenuItem_Click;
+ this.ChartDocToolStripMenuItem.Name = "ChartDocToolStripMenuItem";
+ this.ChartDocToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
+ this.ChartDocToolStripMenuItem.Size = new System.Drawing.Size(313, 26);
+ this.ChartDocToolStripMenuItem.Text = "Документ с диаграммой";
//
// panelControl
//
- panelControl.Dock = DockStyle.Fill;
- panelControl.Location = new Point(0, 24);
- panelControl.Name = "panelControl";
- panelControl.Size = new Size(800, 426);
- panelControl.TabIndex = 1;
+ this.panelControl.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panelControl.Location = new System.Drawing.Point(0, 30);
+ this.panelControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.panelControl.Name = "panelControl";
+ this.panelControl.Size = new System.Drawing.Size(914, 570);
+ this.panelControl.TabIndex = 1;
//
// FormMain
//
- AutoScaleDimensions = new SizeF(7F, 15F);
- AutoScaleMode = AutoScaleMode.Font;
- ClientSize = new Size(800, 450);
- Controls.Add(panelControl);
- Controls.Add(menuStrip);
- MainMenuStrip = menuStrip;
- Name = "FormMain";
- StartPosition = FormStartPosition.CenterScreen;
- Text = "Главная форма";
- WindowState = FormWindowState.Maximized;
- KeyDown += FormMain_KeyDown;
- menuStrip.ResumeLayout(false);
- menuStrip.PerformLayout();
- ResumeLayout(false);
- PerformLayout();
+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(914, 600);
+ this.Controls.Add(this.panelControl);
+ this.Controls.Add(this.menuStrip);
+ this.MainMenuStrip = this.menuStrip;
+ this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.Name = "FormMain";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Главная форма";
+ this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+ this.Load += new System.EventHandler(this.FormMain_Load);
+ this.menuStrip.ResumeLayout(false);
+ this.menuStrip.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
}
#endregion
diff --git a/AbazovApp/AccountAppPlugins/FormMain.cs b/AbazovApp/AccountAppPlugins/FormMain.cs
index 2f23297..0140394 100644
--- a/AbazovApp/AccountAppPlugins/FormMain.cs
+++ b/AbazovApp/AccountAppPlugins/FormMain.cs
@@ -232,5 +232,10 @@ namespace AccountAppPlugins
private void SimpleDocToolStripMenuItem_Click(object sender, EventArgs e) => CreateSimpleDoc();
private void TableDocToolStripMenuItem_Click(object sender, EventArgs e) => CreateTableDoc();
private void ChartDocToolStripMenuItem_Click(object sender, EventArgs e) => CreateChartDoc();
+
+ private void FormMain_Load(object sender, EventArgs e)
+ {
+
+ }
}
}