Additional fixes

This commit is contained in:
abazov73 2023-12-01 11:37:40 +04:00
parent 454452c84b
commit 9128e2ae93
6 changed files with 113 additions and 87 deletions

View File

@ -6,6 +6,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Version>$(VersionPrefix)</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -6,6 +6,7 @@
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild> <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>5.0.0</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -46,6 +46,11 @@ namespace AbazovViewComponents.Components
private void checkedListBox_SelectedIndexChanged(object sender, EventArgs e) 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()); SelectedItemChange?.Invoke(checkedListBox.SelectedItem.ToString());
} }
} }

View File

@ -47,7 +47,8 @@ namespace AbazovViewComponents.Components
var property = properties.FirstOrDefault(x => x.Name == node.Name); var property = properties.FirstOrDefault(x => x.Name == node.Name);
if (property != null) if (property != null)
{ {
property.SetValue(item, node.Text); Type typeOfField = property.PropertyType;
property.SetValue(item, Convert.ChangeType(node.Text, typeOfField));
} }
node = node.Parent; node = node.Parent;
} }
@ -86,5 +87,10 @@ namespace AbazovViewComponents.Components
} }
} }
} }
public void clear()
{
treeView.Nodes.Clear();
}
} }
} }

View File

@ -31,131 +31,139 @@ namespace AccountAppPlugins
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
menuStrip = new MenuStrip(); this.menuStrip = new System.Windows.Forms.MenuStrip();
ControlsStripMenuItem = new ToolStripMenuItem(); this.ControlsStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
ActionsToolStripMenuItem = new ToolStripMenuItem(); this.ActionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
ThesaurusToolStripMenuItem = new ToolStripMenuItem(); this.ThesaurusToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
AddElementToolStripMenuItem = new ToolStripMenuItem(); this.AddElementToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
UpdElementToolStripMenuItem = new ToolStripMenuItem(); this.UpdElementToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
DelElementToolStripMenuItem = new ToolStripMenuItem(); this.DelElementToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
DocsToolStripMenuItem = new ToolStripMenuItem(); this.DocsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
SimpleDocToolStripMenuItem = new ToolStripMenuItem(); this.SimpleDocToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
TableDocToolStripMenuItem = new ToolStripMenuItem(); this.TableDocToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
ChartDocToolStripMenuItem = new ToolStripMenuItem(); this.ChartDocToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
panelControl = new Panel(); this.panelControl = new System.Windows.Forms.Panel();
menuStrip.SuspendLayout(); this.menuStrip.SuspendLayout();
SuspendLayout(); this.SuspendLayout();
// //
// menuStrip // menuStrip
// //
menuStrip.Items.AddRange(new ToolStripItem[] { ControlsStripMenuItem, ActionsToolStripMenuItem, DocsToolStripMenuItem }); this.menuStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
menuStrip.Location = new Point(0, 0); this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
menuStrip.Name = "menuStrip"; this.ControlsStripMenuItem,
menuStrip.Size = new Size(800, 24); this.ActionsToolStripMenuItem,
menuStrip.TabIndex = 0; this.DocsToolStripMenuItem});
menuStrip.Text = "Меню"; 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
// //
ControlsStripMenuItem.Name = "ControlsStripMenuItem"; this.ControlsStripMenuItem.Name = "ControlsStripMenuItem";
ControlsStripMenuItem.Size = new Size(90, 20); this.ControlsStripMenuItem.Size = new System.Drawing.Size(113, 24);
ControlsStripMenuItem.Text = "Компоненты"; this.ControlsStripMenuItem.Text = "Компоненты";
// //
// ActionsToolStripMenuItem // ActionsToolStripMenuItem
// //
ActionsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ThesaurusToolStripMenuItem, AddElementToolStripMenuItem, UpdElementToolStripMenuItem, DelElementToolStripMenuItem }); this.ActionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
ActionsToolStripMenuItem.Name = "ActionsToolStripMenuItem"; this.ThesaurusToolStripMenuItem,
ActionsToolStripMenuItem.Size = new Size(70, 20); this.AddElementToolStripMenuItem,
ActionsToolStripMenuItem.Text = "Действия"; this.UpdElementToolStripMenuItem,
this.DelElementToolStripMenuItem});
this.ActionsToolStripMenuItem.Name = "ActionsToolStripMenuItem";
this.ActionsToolStripMenuItem.Size = new System.Drawing.Size(88, 24);
this.ActionsToolStripMenuItem.Text = "Действия";
// //
// ThesaurusToolStripMenuItem // ThesaurusToolStripMenuItem
// //
ThesaurusToolStripMenuItem.Name = "ThesaurusToolStripMenuItem"; this.ThesaurusToolStripMenuItem.Name = "ThesaurusToolStripMenuItem";
ThesaurusToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.I; this.ThesaurusToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
ThesaurusToolStripMenuItem.Size = new Size(180, 22); this.ThesaurusToolStripMenuItem.Size = new System.Drawing.Size(223, 26);
ThesaurusToolStripMenuItem.Text = "Справочник"; this.ThesaurusToolStripMenuItem.Text = "Справочник";
ThesaurusToolStripMenuItem.Click += ThesaurusToolStripMenuItem_Click;
// //
// AddElementToolStripMenuItem // AddElementToolStripMenuItem
// //
AddElementToolStripMenuItem.Name = "AddElementToolStripMenuItem"; this.AddElementToolStripMenuItem.Name = "AddElementToolStripMenuItem";
AddElementToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.A; this.AddElementToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
AddElementToolStripMenuItem.Size = new Size(180, 22); this.AddElementToolStripMenuItem.Size = new System.Drawing.Size(223, 26);
AddElementToolStripMenuItem.Text = "Добавить"; this.AddElementToolStripMenuItem.Text = "Добавить";
AddElementToolStripMenuItem.Click += AddElementToolStripMenuItem_Click;
// //
// UpdElementToolStripMenuItem // UpdElementToolStripMenuItem
// //
UpdElementToolStripMenuItem.Name = "UpdElementToolStripMenuItem"; this.UpdElementToolStripMenuItem.Name = "UpdElementToolStripMenuItem";
UpdElementToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.U; this.UpdElementToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U)));
UpdElementToolStripMenuItem.Size = new Size(180, 22); this.UpdElementToolStripMenuItem.Size = new System.Drawing.Size(223, 26);
UpdElementToolStripMenuItem.Text = "Изменить"; this.UpdElementToolStripMenuItem.Text = "Изменить";
UpdElementToolStripMenuItem.Click += UpdElementToolStripMenuItem_Click;
// //
// DelElementToolStripMenuItem // DelElementToolStripMenuItem
// //
DelElementToolStripMenuItem.Name = "DelElementToolStripMenuItem"; this.DelElementToolStripMenuItem.Name = "DelElementToolStripMenuItem";
DelElementToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.D; this.DelElementToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D)));
DelElementToolStripMenuItem.Size = new Size(180, 22); this.DelElementToolStripMenuItem.Size = new System.Drawing.Size(223, 26);
DelElementToolStripMenuItem.Text = "Удалить"; this.DelElementToolStripMenuItem.Text = "Удалить";
DelElementToolStripMenuItem.Click += DelElementToolStripMenuItem_Click;
// //
// DocsToolStripMenuItem // DocsToolStripMenuItem
// //
DocsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { SimpleDocToolStripMenuItem, TableDocToolStripMenuItem, ChartDocToolStripMenuItem }); this.DocsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
DocsToolStripMenuItem.Name = "DocsToolStripMenuItem"; this.SimpleDocToolStripMenuItem,
DocsToolStripMenuItem.Size = new Size(82, 20); this.TableDocToolStripMenuItem,
DocsToolStripMenuItem.Text = "Документы"; this.ChartDocToolStripMenuItem});
this.DocsToolStripMenuItem.Name = "DocsToolStripMenuItem";
this.DocsToolStripMenuItem.Size = new System.Drawing.Size(101, 24);
this.DocsToolStripMenuItem.Text = "Документы";
// //
// SimpleDocToolStripMenuItem // SimpleDocToolStripMenuItem
// //
SimpleDocToolStripMenuItem.Name = "SimpleDocToolStripMenuItem"; this.SimpleDocToolStripMenuItem.Name = "SimpleDocToolStripMenuItem";
SimpleDocToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.S; this.SimpleDocToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
SimpleDocToolStripMenuItem.Size = new Size(233, 22); this.SimpleDocToolStripMenuItem.Size = new System.Drawing.Size(313, 26);
SimpleDocToolStripMenuItem.Text = "Простой документ"; this.SimpleDocToolStripMenuItem.Text = "Простой документ";
SimpleDocToolStripMenuItem.Click += SimpleDocToolStripMenuItem_Click;
// //
// TableDocToolStripMenuItem // TableDocToolStripMenuItem
// //
TableDocToolStripMenuItem.Name = "TableDocToolStripMenuItem"; this.TableDocToolStripMenuItem.Name = "TableDocToolStripMenuItem";
TableDocToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.T; this.TableDocToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
TableDocToolStripMenuItem.Size = new Size(233, 22); this.TableDocToolStripMenuItem.Size = new System.Drawing.Size(313, 26);
TableDocToolStripMenuItem.Text = "Документ с таблицой"; this.TableDocToolStripMenuItem.Text = "Документ с таблицой";
TableDocToolStripMenuItem.Click += TableDocToolStripMenuItem_Click;
// //
// ChartDocToolStripMenuItem // ChartDocToolStripMenuItem
// //
ChartDocToolStripMenuItem.Name = "ChartDocToolStripMenuItem"; this.ChartDocToolStripMenuItem.Name = "ChartDocToolStripMenuItem";
ChartDocToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.C; this.ChartDocToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
ChartDocToolStripMenuItem.Size = new Size(233, 22); this.ChartDocToolStripMenuItem.Size = new System.Drawing.Size(313, 26);
ChartDocToolStripMenuItem.Text = "Документ с диаграммой"; this.ChartDocToolStripMenuItem.Text = "Документ с диаграммой";
ChartDocToolStripMenuItem.Click += ChartDocToolStripMenuItem_Click;
// //
// panelControl // panelControl
// //
panelControl.Dock = DockStyle.Fill; this.panelControl.Dock = System.Windows.Forms.DockStyle.Fill;
panelControl.Location = new Point(0, 24); this.panelControl.Location = new System.Drawing.Point(0, 30);
panelControl.Name = "panelControl"; this.panelControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
panelControl.Size = new Size(800, 426); this.panelControl.Name = "panelControl";
panelControl.TabIndex = 1; this.panelControl.Size = new System.Drawing.Size(914, 570);
this.panelControl.TabIndex = 1;
// //
// FormMain // FormMain
// //
AutoScaleDimensions = new SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
ClientSize = new Size(800, 450); this.ClientSize = new System.Drawing.Size(914, 600);
Controls.Add(panelControl); this.Controls.Add(this.panelControl);
Controls.Add(menuStrip); this.Controls.Add(this.menuStrip);
MainMenuStrip = menuStrip; this.MainMenuStrip = this.menuStrip;
Name = "FormMain"; this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
StartPosition = FormStartPosition.CenterScreen; this.Name = "FormMain";
Text = "Главная форма"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
WindowState = FormWindowState.Maximized; this.Text = "Главная форма";
KeyDown += FormMain_KeyDown; this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
menuStrip.ResumeLayout(false); this.Load += new System.EventHandler(this.FormMain_Load);
menuStrip.PerformLayout(); this.menuStrip.ResumeLayout(false);
ResumeLayout(false); this.menuStrip.PerformLayout();
PerformLayout(); this.ResumeLayout(false);
this.PerformLayout();
} }
#endregion #endregion

View File

@ -232,5 +232,10 @@ namespace AccountAppPlugins
private void SimpleDocToolStripMenuItem_Click(object sender, EventArgs e) => CreateSimpleDoc(); private void SimpleDocToolStripMenuItem_Click(object sender, EventArgs e) => CreateSimpleDoc();
private void TableDocToolStripMenuItem_Click(object sender, EventArgs e) => CreateTableDoc(); private void TableDocToolStripMenuItem_Click(object sender, EventArgs e) => CreateTableDoc();
private void ChartDocToolStripMenuItem_Click(object sender, EventArgs e) => CreateChartDoc(); private void ChartDocToolStripMenuItem_Click(object sender, EventArgs e) => CreateChartDoc();
private void FormMain_Load(object sender, EventArgs e)
{
}
} }
} }