добавили плюшки

This commit is contained in:
klavirshik 2024-08-23 07:47:51 +02:00
parent 9385ec0ca0
commit f493dc1e7a
18 changed files with 282 additions and 38 deletions

View File

@ -35,6 +35,11 @@
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.button2 = new System.Windows.Forms.Button();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.ss_activ = new System.Windows.Forms.ToolStripStatusLabel();
this.ss_close = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
@ -56,6 +61,8 @@
this.tabPage5 = new System.Windows.Forms.TabPage(); this.tabPage5 = new System.Windows.Forms.TabPage();
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label16 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label();
this.cm_words = new System.Windows.Forms.ContextMenuStrip(this.components);
this.WordsReboot = new System.Windows.Forms.ToolStripMenuItem();
this.cb_comp = new System.Windows.Forms.ComboBox(); this.cb_comp = new System.Windows.Forms.ComboBox();
this.checkControl1 = new Reseter2.CheckControl(); this.checkControl1 = new Reseter2.CheckControl();
this.treeView1 = new Reseter2.NewTreeView(); this.treeView1 = new Reseter2.NewTreeView();
@ -64,12 +71,14 @@
this.settingWordsControl1 = new Reseter2.Setting.SettingWordsControl(); this.settingWordsControl1 = new Reseter2.Setting.SettingWordsControl();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.tabPage2.SuspendLayout(); this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout(); this.tabPage3.SuspendLayout();
this.cm_history.SuspendLayout(); this.cm_history.SuspendLayout();
this.tabPage4.SuspendLayout(); this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout(); this.tabPage5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.cm_words.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// label1 // label1
@ -120,7 +129,9 @@
// //
// tabPage1 // tabPage1
// //
this.tabPage1.BackColor = System.Drawing.SystemColors.Window; this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
this.tabPage1.Controls.Add(this.button2);
this.tabPage1.Controls.Add(this.statusStrip1);
this.tabPage1.Controls.Add(this.flowLayoutPanel1); this.tabPage1.Controls.Add(this.flowLayoutPanel1);
this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
@ -129,15 +140,59 @@
this.tabPage1.TabIndex = 0; this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Задания"; this.tabPage1.Text = "Задания";
// //
// button2
//
this.button2.Location = new System.Drawing.Point(236, 665);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(165, 23);
this.button2.TabIndex = 2;
this.button2.Text = "Очистить все завершенные";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ss_activ,
this.ss_close,
this.toolStripStatusLabel1});
this.statusStrip1.Location = new System.Drawing.Point(3, 663);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(396, 22);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
// ss_activ
//
this.ss_activ.Name = "ss_activ";
this.ss_activ.Size = new System.Drawing.Size(61, 17);
this.ss_activ.Text = "Активные";
this.ss_activ.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
//
// ss_close
//
this.ss_close.Name = "ss_close";
this.ss_close.Size = new System.Drawing.Size(85, 17);
this.ss_close.Text = "Завершенные";
this.ss_close.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17);
this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
//
// flowLayoutPanel1 // flowLayoutPanel1
// //
this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.flowLayoutPanel1.AutoScroll = true; this.flowLayoutPanel1.AutoScroll = true;
this.flowLayoutPanel1.BackColor = System.Drawing.SystemColors.Window; this.flowLayoutPanel1.BackColor = System.Drawing.SystemColors.Window;
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3); this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(396, 682); this.flowLayoutPanel1.Size = new System.Drawing.Size(396, 657);
this.flowLayoutPanel1.TabIndex = 0; this.flowLayoutPanel1.TabIndex = 0;
this.flowLayoutPanel1.WrapContents = false; this.flowLayoutPanel1.WrapContents = false;
// //
@ -283,27 +338,28 @@
// //
// cm_history // cm_history
// //
this.cm_history.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.cm_history.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cm_history.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.sm_RebootItem, this.sm_RebootItem,
this.sm_SaveItem}); this.sm_SaveItem});
this.cm_history.Name = "cm_history"; this.cm_history.Name = "cm_history";
this.cm_history.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; this.cm_history.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.cm_history.ShowCheckMargin = true; this.cm_history.ShowImageMargin = false;
this.cm_history.Size = new System.Drawing.Size(177, 48); this.cm_history.Size = new System.Drawing.Size(156, 70);
this.cm_history.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(this.cm_history_Closed); this.cm_history.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(this.cm_history_Closed);
this.cm_history.Opening += new System.ComponentModel.CancelEventHandler(this.cm_history_Opening); this.cm_history.Opening += new System.ComponentModel.CancelEventHandler(this.cm_history_Opening);
// //
// sm_RebootItem // sm_RebootItem
// //
this.sm_RebootItem.Name = "sm_RebootItem"; this.sm_RebootItem.Name = "sm_RebootItem";
this.sm_RebootItem.Size = new System.Drawing.Size(176, 22); this.sm_RebootItem.Size = new System.Drawing.Size(155, 22);
this.sm_RebootItem.Text = "Перезагрузить"; this.sm_RebootItem.Text = "Перезагрузить";
this.sm_RebootItem.Click += new System.EventHandler(this.sm_RebootItem_Click); this.sm_RebootItem.Click += new System.EventHandler(this.sm_RebootItem_Click);
// //
// sm_SaveItem // sm_SaveItem
// //
this.sm_SaveItem.Name = "sm_SaveItem"; this.sm_SaveItem.Name = "sm_SaveItem";
this.sm_SaveItem.Size = new System.Drawing.Size(176, 22); this.sm_SaveItem.Size = new System.Drawing.Size(155, 22);
this.sm_SaveItem.Text = "Сохранить"; this.sm_SaveItem.Text = "Сохранить";
this.sm_SaveItem.Click += new System.EventHandler(this.sm_SaveItem_Click); this.sm_SaveItem.Click += new System.EventHandler(this.sm_SaveItem_Click);
// //
@ -360,12 +416,28 @@
this.label16.TabIndex = 0; this.label16.TabIndex = 0;
this.label16.Text = "Reseter2"; this.label16.Text = "Reseter2";
// //
// cm_words
//
this.cm_words.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.WordsReboot});
this.cm_words.Name = "cm_words";
this.cm_words.ShowImageMargin = false;
this.cm_words.Size = new System.Drawing.Size(125, 26);
//
// WordsReboot
//
this.WordsReboot.Name = "WordsReboot";
this.WordsReboot.Size = new System.Drawing.Size(124, 22);
this.WordsReboot.Text = "Перезарузить";
this.WordsReboot.Click += new System.EventHandler(this.WordsReboot_Click);
//
// cb_comp // cb_comp
// //
this.cb_comp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.cb_comp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.cb_comp.DropDownHeight = 1; this.cb_comp.DropDownHeight = 1;
this.cb_comp.FormattingEnabled = true; this.cb_comp.FormattingEnabled = true;
this.cb_comp.IntegralHeight = false;
this.cb_comp.Items.AddRange(new object[] { this.cb_comp.Items.AddRange(new object[] {
"889", "889",
"fdfd"}); "fdfd"});
@ -443,6 +515,9 @@
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
this.tabControl1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.tabPage2.ResumeLayout(false); this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout(); this.tabPage2.PerformLayout();
this.tabPage3.ResumeLayout(false); this.tabPage3.ResumeLayout(false);
@ -452,6 +527,7 @@
this.tabPage5.ResumeLayout(false); this.tabPage5.ResumeLayout(false);
this.tabPage5.PerformLayout(); this.tabPage5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.cm_words.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -490,6 +566,13 @@
private Setting.SettingRebootControl settingRebootControl1; private Setting.SettingRebootControl settingRebootControl1;
private Setting.SettingSCCMControl settingSCCMControl1; private Setting.SettingSCCMControl settingSCCMControl1;
private System.Windows.Forms.ComboBox cb_comp; private System.Windows.Forms.ComboBox cb_comp;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel ss_activ;
private System.Windows.Forms.ToolStripStatusLabel ss_close;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.ContextMenuStrip cm_words;
private System.Windows.Forms.ToolStripMenuItem WordsReboot;
} }
} }

View File

@ -14,6 +14,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace Reseter2 namespace Reseter2
{ {
public partial class Form1 : Form public partial class Form1 : Form
@ -56,7 +57,6 @@ namespace Reseter2
InitializeComponent(); InitializeComponent();
settingWordsControl1.treeView = treeView1;
this.Save += settingWordsControl1.Save; this.Save += settingWordsControl1.Save;
this.Save += settingSCCMControl1.Save; this.Save += settingSCCMControl1.Save;
this.Save += settingRebootControl1.Save; this.Save += settingRebootControl1.Save;
@ -64,14 +64,14 @@ namespace Reseter2
this.UpdateSetting += settingWordsControl1.UpdateSetting; this.UpdateSetting += settingWordsControl1.UpdateSetting;
this.UpdateSetting += settingSCCMControl1.UpdateSetting; this.UpdateSetting += settingSCCMControl1.UpdateSetting;
this.UpdateSetting += settingRebootControl1.UpdateSetting; this.UpdateSetting += settingRebootControl1.UpdateSetting;
this.settingWordsControl1.UpdateTree = UpdateTree;
// cb_comp.DropDownStyle = ComboBoxStyle.DropDown; // cb_comp.DropDownStyle = ComboBoxStyle.DropDown;
checkControl1.updateCheck += CheckControl1_updateCheck; checkControl1.updateCheck += CheckControl1_updateCheck;
flowLayoutPanel1.AutoScrollMinSize = new Size(0, 683) ; flowLayoutPanel1.AutoScrollMinSize = new Size(0, 658) ;
flowLayoutPanel1.VerticalScroll.Visible = true; flowLayoutPanel1.VerticalScroll.Visible = true;
Reseter.SetForm(flowLayoutPanel1); Reseter.SetForm(flowLayoutPanel1, this);
HistoryList.Update += Update_lb; HistoryList.Update += Update_lb;
lb_history.DataSource = HistoryList.Hitem; lb_history.DataSource = HistoryList.Hitem;
lb_history.DisplayMember = "ToStr"; lb_history.DisplayMember = "ToStr";
@ -82,13 +82,15 @@ namespace Reseter2
//treeView1.SelectedNode. //treeView1.SelectedNode.
//treeView1.MouseCaptureChanged.; //treeView1.MouseCaptureChanged.;
tabControl1.SelectedIndex = 1; tabControl1.SelectedIndex = 1;
} }
public void UpdateTree()
{
treeView1.Nodes.Clear();
treeView1.Nodes.AddRange(WordsList.ListNodes());
}
private void bt_reset_Click(object sender, EventArgs e) private void bt_reset_Click(object sender, EventArgs e)
{ {
@ -98,7 +100,25 @@ namespace Reseter2
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
Reseter.Tick(); int Act;
int Cls;
Reseter.Tick(out Act,out Cls) ;
if (Act>0)
{
ss_activ.Text = "Активно:" + Act;
}
else
{
ss_activ.Text = "";
}
if (Cls > 0)
{
ss_close.Text = "Завершено:" + Cls;
}
else
{
ss_close.Text = "";
}
} }
public void Update_lb() public void Update_lb()
{ {
@ -276,7 +296,7 @@ namespace Reseter2
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{ {
if (e.Node.Tag is WordsComp) if (e.Button == MouseButtons.Left && e.Node.Tag is WordsComp)
{ {
WordsComp wordsComp = (WordsComp)e.Node.Tag; WordsComp wordsComp = (WordsComp)e.Node.Tag;
@ -294,13 +314,23 @@ namespace Reseter2
TreeView tree = (TreeView)sender; TreeView tree = (TreeView)sender;
if(e.Button == MouseButtons.Right) Rectangle BoundsNode = new(e.Node.Bounds.X - 43, e.Node.Bounds.Y, e.Node.Bounds.Width + 43, e.Node.Bounds.Height);
if (e.Button == MouseButtons.Right)
{ {
tree.SelectedNode = e.Node; if (BoundsNode.Contains(e.Location) && e.Node.Tag is WordsComp)
{
tree.SelectedNode = e.Node;
cm_words.Show(tree.PointToScreen(e.Location));
}
else
{
tree.SelectedNode = null;
}
} }
//tree.BeginUpdate(); //tree.BeginUpdate();
Rectangle BoundsIcon = new Rectangle(e.Node.Bounds.X -43, e.Node.Bounds.Y + 2, 17, 18); Rectangle BoundsIcon = new(e.Node.Bounds.X -43, e.Node.Bounds.Y + 2, 17, 18);
if (BoundsIcon.Contains(e.Location)) if (e.Button == MouseButtons.Left && BoundsIcon.Contains(e.Location))
{ {
e.Node.Checked = !e.Node.Checked; e.Node.Checked = !e.Node.Checked;
if (e.Node.Checked) if (e.Node.Checked)
@ -360,7 +390,11 @@ namespace Reseter2
{ {
comps.AddRange(treeViewCheckOn(treeView1.Nodes[i])); comps.AddRange(treeViewCheckOn(treeView1.Nodes[i]));
} }
if(comps.Count == 0)
{
MessageBox.Show("Не выбранно ни одного ПК");
return;
}
DialogResult result = MessageBox.Show("Будет перезагруженно " + comps.Count() + " компьютеров.\nПродолжить?", DialogResult result = MessageBox.Show("Будет перезагруженно " + comps.Count() + " компьютеров.\nПродолжить?",
"Запуск многопоточной перезагрузки.", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); "Запуск многопоточной перезагрузки.", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.Yes) { if (result == DialogResult.Yes) {
@ -442,6 +476,27 @@ namespace Reseter2
UpdateSetting(); UpdateSetting();
} }
} }
private void button2_Click(object sender, EventArgs e)
{
Reseter.ClearCanceled();
}
private void WordsReboot_Click(object sender, EventArgs e)
{
if(treeView1.SelectedNode.Tag is WordsComp)
{
WordsComp wordsComp = (WordsComp)treeView1.SelectedNode.Tag;
DialogResult result = MessageBox.Show("Перезагрузить ПК: " + wordsComp.NameNode(), "Создание новой задачи", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.Yes)
{
Reseter.AddTask(wordsComp.GetComp());
tabControl1.SelectedIndex = 0;
}
}
}
} }
} }

View File

@ -120,6 +120,9 @@
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>122, 17</value> <value>122, 17</value>
</metadata> </metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>645, 17</value>
</metadata>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>425, 17</value> <value>425, 17</value>
</metadata> </metadata>
@ -128,7 +131,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVy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AAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -537,6 +540,9 @@
<metadata name="cm_history.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="cm_history.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>209, 17</value> <value>209, 17</value>
</metadata> </metadata>
<metadata name="cm_words.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>761, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View File

@ -29,6 +29,6 @@ namespace Reseter2
resetertask.historyItem = HistoryList.Add(resetertask); resetertask.historyItem = HistoryList.Add(resetertask);
HistoryList.Updated(); HistoryList.Updated();
} }
public abstract int ActionIs();
} }
} }

View File

@ -15,7 +15,7 @@ namespace Reseter2
public DateTime StartTime = DateTime.Now; public DateTime StartTime = DateTime.Now;
public IComp Comp { get; } public IComp Comp { get; }
public AStatusTask StatusTask { get; set; } public AStatusTask StatusTask { get; set; }
private TaskControl taskControl; public TaskControl taskControl;
private Pinger Pingers; private Pinger Pingers;
public Stopwatch sw = new Stopwatch(); public Stopwatch sw = new Stopwatch();
public PingResult pingResult; public PingResult pingResult;

View File

@ -16,7 +16,9 @@ namespace Reseter2.Setting
partial class SettingWordsControl : UserControl partial class SettingWordsControl : UserControl
{ {
public NewTreeView treeView;
public delegate void DUpdateTree();
public DUpdateTree UpdateTree;
public SettingWordsControl() public SettingWordsControl()
{ {
InitializeComponent(); InitializeComponent();
@ -37,11 +39,7 @@ namespace Reseter2.Setting
DialogResult result = bilderWords.ShowDialog(); DialogResult result = bilderWords.ShowDialog();
if (result == DialogResult.OK) if (result == DialogResult.OK)
{ {
if (treeView != null) UpdateTree();
{
treeView.Nodes.Clear();
treeView.Nodes.AddRange(WordsList.ListNodes());
}
} }
} }

View File

@ -28,5 +28,9 @@ namespace Reseter2
{ {
return "Canceled"; return "Canceled";
} }
public override int ActionIs()
{
return 0;
}
} }
} }

View File

@ -50,5 +50,9 @@ namespace Reseter2
{ {
return "Send RST"; return "Send RST";
} }
public override int ActionIs()
{
return 1;
}
} }
} }

View File

@ -32,5 +32,9 @@ namespace Reseter2
return _error; return _error;
} }
public override int ActionIs()
{
return 0;
}
} }
} }

View File

@ -28,5 +28,9 @@ namespace Reseter2
{ {
return "Stop"; return "Stop";
} }
public override int ActionIs()
{
return 0;
}
} }
} }

View File

@ -29,5 +29,9 @@ namespace Reseter2
{ {
return "Succes"; return "Succes";
} }
public override int ActionIs()
{
return 0;
}
} }
} }

View File

@ -50,5 +50,9 @@ namespace Reseter2
{ {
return "Rebooting"; return "Rebooting";
} }
public override int ActionIs()
{
return 1;
}
} }
} }

View File

@ -50,5 +50,10 @@ namespace Reseter2
return "Check NET"; return "Check NET";
} }
public override int ActionIs()
{
return 1;
}
} }
} }

View File

@ -46,7 +46,10 @@
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.lb_time = new System.Windows.Forms.Label(); this.lb_time = new System.Windows.Forms.Label();
this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.cm_task = new System.Windows.Forms.ContextMenuStrip(this.components);
this.cm_taskSave = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.cm_task.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// label1 // label1
@ -197,11 +200,28 @@
this.imageList1.Images.SetKeyName(6, "5icon-64.png"); this.imageList1.Images.SetKeyName(6, "5icon-64.png");
this.imageList1.Images.SetKeyName(7, "7icon-64.png"); this.imageList1.Images.SetKeyName(7, "7icon-64.png");
// //
// cm_task
//
this.cm_task.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cm_taskSave});
this.cm_task.Name = "cm_task";
this.cm_task.ShowImageMargin = false;
this.cm_task.Size = new System.Drawing.Size(109, 26);
this.cm_task.Text = "Сохранить";
//
// cm_taskSave
//
this.cm_taskSave.Name = "cm_taskSave";
this.cm_taskSave.Size = new System.Drawing.Size(108, 22);
this.cm_taskSave.Text = "Сохранить";
this.cm_taskSave.Click += new System.EventHandler(this.cm_taskSave_Click);
//
// TaskControl // TaskControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLightLight; this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.ContextMenuStrip = this.cm_task;
this.Controls.Add(this.lb_time); this.Controls.Add(this.lb_time);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.button3); this.Controls.Add(this.button3);
@ -220,6 +240,7 @@
this.Name = "TaskControl"; this.Name = "TaskControl";
this.Size = new System.Drawing.Size(371, 77); this.Size = new System.Drawing.Size(371, 77);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.cm_task.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -243,5 +264,7 @@
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lb_time; private System.Windows.Forms.Label lb_time;
private System.Windows.Forms.ImageList imageList1; private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ContextMenuStrip cm_task;
private System.Windows.Forms.ToolStripMenuItem cm_taskSave;
} }
} }

View File

@ -1,4 +1,5 @@
using System; using Reseter2.Words;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
@ -8,6 +9,7 @@ using System.Net;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Reseter2 namespace Reseter2
{ {
@ -15,6 +17,8 @@ namespace Reseter2
partial class TaskControl : UserControl partial class TaskControl : UserControl
{ {
ReseterTask reseterTask; ReseterTask reseterTask;
public delegate void DUpdateTree();
public DUpdateTree UpdateTree;
public TaskControl() public TaskControl()
{ {
reseterTask = null; reseterTask = null;
@ -76,5 +80,15 @@ namespace Reseter2
{ {
reseterTask.RebootReturn(); reseterTask.RebootReturn();
} }
private void cm_taskSave_Click(object sender, EventArgs e)
{
BilderWords bilderWords = new BilderWords(reseterTask.Comp);
DialogResult result = bilderWords.ShowDialog();
if (result == DialogResult.OK)
{
UpdateTree();
}
}
} }
} }

View File

@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk
lAIAAk1TRnQBSQFMAgEBCAEAASgBAAEoAQABQAEAAUABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgEAAEB lAIAAk1TRnQBSQFMAgEBCAEAATgBAAE4AQABQAEAAUABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgEAAEB
AgABwAMAAQEBAAEYBgABQAEC/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A AgABwAMAAQEBAAEYBgABQAEC/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
@ -2945,4 +2945,7 @@
AQ8C/wHwBAABDwL/Af4EAAF/Av8B/gQAAX8C/wH+BAABfwL/Af4EAAF/Af8L AQ8C/wHwBAABDwL/Af4EAAF/Av8B/gQAAX8C/wH+BAABfwL/Af4EAAF/Af8L
</value> </value>
</data> </data>
<metadata name="cm_task.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
</root> </root>

View File

@ -41,6 +41,7 @@ namespace Reseter2.Words
WordsComp item = new WordsComp(compId); WordsComp item = new WordsComp(compId);
WordsList.AddItem(item, ChangeCategory); WordsList.AddItem(item, ChangeCategory);
treeView1.Nodes.AddRange(WordsList.ListNodes(ChangeCategory)); treeView1.Nodes.AddRange(WordsList.ListNodes(ChangeCategory));
treeView1.SelectedNode = treeView1.Nodes[treeView1.Nodes.Count-1];
} }
private void LoadForm() private void LoadForm()

View File

@ -5,10 +5,12 @@ using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Reflection.Emit; using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Remoting.Metadata.W3cXsd2001; using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip;
namespace Reseter2 namespace Reseter2
{ {
@ -16,10 +18,12 @@ namespace Reseter2
{ {
private static List<ReseterTask> list_task = new List<ReseterTask>(); private static List<ReseterTask> list_task = new List<ReseterTask>();
private static Panel flow_conteiner; private static Panel flow_conteiner;
private static Form1 Main;
public static void SetForm(Panel flow_cntr) public static void SetForm(Panel flow_cntr, Form1 main)
{ {
flow_conteiner = flow_cntr; flow_conteiner = flow_cntr;
Main = main;
} }
public static void AddTask(String name) public static void AddTask(String name)
{ {
@ -52,13 +56,29 @@ namespace Reseter2
{ {
TaskControl taskControl = new TaskControl(); TaskControl taskControl = new TaskControl();
taskControl.UpdateTree = Main.UpdateTree;
ReseterTask reseterTask = new ReseterTask(compName, taskControl); ReseterTask reseterTask = new ReseterTask(compName, taskControl);
taskControl.Intit(reseterTask); taskControl.Intit(reseterTask);
flow_conteiner.Controls.Add(taskControl); flow_conteiner.Controls.Add(taskControl);
list_task.Add(reseterTask); list_task.Add(reseterTask);
} }
public static async void Clear(ReseterTask reseterTask, TaskControl taskControl) public static void ClearCanceled()
{
foreach (var item in list_task)
{
if (item.StatusTask.ActionIs() == 0)
{
flow_conteiner.Controls.Remove(item.taskControl);
list_task.Remove(item);
ClearCanceled();
return;
}
}
}
public static async void Clear(ReseterTask reseterTask, TaskControl taskControl)
{ {
if(!(reseterTask.StatusTask is StatusRebootError || if(!(reseterTask.StatusTask is StatusRebootError ||
reseterTask.StatusTask is StatusRebootStop || reseterTask.StatusTask is StatusRebootStop ||
@ -73,21 +93,33 @@ namespace Reseter2
list_task.Remove(reseterTask); list_task.Remove(reseterTask);
} }
public static async void Tick() public static void Tick(out int Action, out int Close)
{ {
Action = 0;
Close = 0;
try try
{ {
foreach (var item in list_task) foreach (var item in list_task)
{ {
item.Tick(); item.Tick();
if(item.StatusTask.ActionIs() == 1)
{
Action++;
}
else
{
Close++;
}
} }
} }
catch catch
{ {
} }
} }
} }
} }