From 602232ce5b182c7aa821457043abec7e9ddd7ed3 Mon Sep 17 00:00:00 2001 From: klavirshik Date: Tue, 6 Aug 2024 09:36:37 +0200 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=20=D1=81=D0=BB=D0=BE=D0=B2=D0=B0=D1=80=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Reseter2/Form1.Designer.cs | 74 ++++++++-- Reseter2/Form1.cs | 105 +++++++++++++- Reseter2/Form1.resx | 3 + Reseter2/History/HistoryItem.cs | 6 + Reseter2/PingResult.cs | 10 ++ Reseter2/Pinger.cs | 4 +- Reseter2/Reseter2.csproj | 23 +++ Reseter2/StatusCanceled.cs | 32 +++++ Reseter2/StatusReboot.cs | 2 +- Reseter2/StatusRebootError.cs | 31 ++++ Reseter2/StatusRebooting.cs | 2 +- Reseter2/StausPreReboot.cs | 19 ++- Reseter2/Words/IWordsItem.cs | 22 +++ Reseter2/Words/WordsCategory.cs | 23 +++ .../Words/WordsCategoryControl.Designer.cs | 113 +++++++++++++++ Reseter2/Words/WordsCategoryControl.cs | 32 +++++ Reseter2/Words/WordsCategoryControl.resx | 120 ++++++++++++++++ Reseter2/Words/WordsItemControl.Designer.cs | 132 ++++++++++++++++++ Reseter2/Words/WordsItemControl.cs | 29 ++++ Reseter2/Words/WordsItemControl.resx | 120 ++++++++++++++++ Reseter2/Words/WordsList.cs | 18 +++ Reseter2/reseter.cs | 1 + 22 files changed, 900 insertions(+), 21 deletions(-) create mode 100644 Reseter2/StatusCanceled.cs create mode 100644 Reseter2/StatusRebootError.cs create mode 100644 Reseter2/Words/IWordsItem.cs create mode 100644 Reseter2/Words/WordsCategory.cs create mode 100644 Reseter2/Words/WordsCategoryControl.Designer.cs create mode 100644 Reseter2/Words/WordsCategoryControl.cs create mode 100644 Reseter2/Words/WordsCategoryControl.resx create mode 100644 Reseter2/Words/WordsItemControl.Designer.cs create mode 100644 Reseter2/Words/WordsItemControl.cs create mode 100644 Reseter2/Words/WordsItemControl.resx create mode 100644 Reseter2/Words/WordsList.cs diff --git a/Reseter2/Form1.Designer.cs b/Reseter2/Form1.Designer.cs index 88dd25e..06c5069 100644 --- a/Reseter2/Form1.Designer.cs +++ b/Reseter2/Form1.Designer.cs @@ -35,6 +35,7 @@ this.timer1 = new System.Windows.Forms.Timer(this.components); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.button1 = new System.Windows.Forms.Button(); @@ -43,18 +44,23 @@ this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.lb_history = new System.Windows.Forms.ListBox(); + this.cm_history = new System.Windows.Forms.ContextMenuStrip(this.components); + this.sm_RebootItem = new System.Windows.Forms.ToolStripMenuItem(); + this.sm_SaveItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabPage4 = new System.Windows.Forms.TabPage(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.flow_words = new System.Windows.Forms.FlowLayoutPanel(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); this.tabPage3.SuspendLayout(); + this.cm_history.SuspendLayout(); this.SuspendLayout(); // // tb_comp // this.tb_comp.Location = new System.Drawing.Point(67, 12); this.tb_comp.Name = "tb_comp"; - this.tb_comp.Size = new System.Drawing.Size(195, 20); + this.tb_comp.Size = new System.Drawing.Size(207, 20); this.tb_comp.TabIndex = 0; // // label1 @@ -69,7 +75,7 @@ // // bt_reset // - this.bt_reset.Location = new System.Drawing.Point(268, 10); + this.bt_reset.Location = new System.Drawing.Point(280, 9); this.bt_reset.Name = "bt_reset"; this.bt_reset.Size = new System.Drawing.Size(122, 23); this.bt_reset.TabIndex = 2; @@ -109,8 +115,20 @@ this.tabPage1.TabIndex = 0; this.tabPage1.Text = "Задания"; // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.AutoScroll = true; + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(396, 682); + this.flowLayoutPanel1.TabIndex = 0; + this.flowLayoutPanel1.WrapContents = false; + // // tabPage2 // + this.tabPage2.Controls.Add(this.flow_words); this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); @@ -189,6 +207,7 @@ // this.lb_history.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.lb_history.ContextMenuStrip = this.cm_history; this.lb_history.Font = new System.Drawing.Font("Cascadia Code", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lb_history.FormattingEnabled = true; this.lb_history.ItemHeight = 15; @@ -196,6 +215,33 @@ this.lb_history.Name = "lb_history"; this.lb_history.Size = new System.Drawing.Size(396, 634); this.lb_history.TabIndex = 0; + this.lb_history.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lb_history_MouseDown); + this.lb_history.MouseLeave += new System.EventHandler(this.lb_history_MouseLeave); + this.lb_history.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lb_history_MouseMove); + // + // cm_history + // + this.cm_history.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.sm_RebootItem, + this.sm_SaveItem}); + this.cm_history.Name = "cm_history"; + this.cm_history.ShowImageMargin = false; + this.cm_history.Size = new System.Drawing.Size(130, 48); + 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); + // + // sm_RebootItem + // + this.sm_RebootItem.Name = "sm_RebootItem"; + this.sm_RebootItem.Size = new System.Drawing.Size(129, 22); + this.sm_RebootItem.Text = "Перезагрузить"; + this.sm_RebootItem.Click += new System.EventHandler(this.sm_RebootItem_Click); + // + // sm_SaveItem + // + this.sm_SaveItem.Name = "sm_SaveItem"; + this.sm_SaveItem.Size = new System.Drawing.Size(129, 22); + this.sm_SaveItem.Text = "Сохранить"; // // tabPage4 // @@ -207,16 +253,14 @@ this.tabPage4.Text = "Настройки"; this.tabPage4.UseVisualStyleBackColor = true; // - // flowLayoutPanel1 + // flow_words // - this.flowLayoutPanel1.AutoScroll = true; - this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(396, 682); - this.flowLayoutPanel1.TabIndex = 0; - this.flowLayoutPanel1.WrapContents = false; + this.flow_words.AutoScroll = true; + this.flow_words.Dock = System.Windows.Forms.DockStyle.Fill; + this.flow_words.Location = new System.Drawing.Point(3, 3); + this.flow_words.Name = "flow_words"; + this.flow_words.Size = new System.Drawing.Size(396, 682); + this.flow_words.TabIndex = 0; // // Form1 // @@ -231,8 +275,10 @@ this.Text = "Reseter2"; this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); + this.tabPage2.ResumeLayout(false); this.tabPage3.ResumeLayout(false); this.tabPage3.PerformLayout(); + this.cm_history.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -256,6 +302,10 @@ private System.Windows.Forms.Label label3; private System.Windows.Forms.Button button1; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.ContextMenuStrip cm_history; + private System.Windows.Forms.ToolStripMenuItem sm_RebootItem; + private System.Windows.Forms.ToolStripMenuItem sm_SaveItem; + private System.Windows.Forms.FlowLayoutPanel flow_words; } } diff --git a/Reseter2/Form1.cs b/Reseter2/Form1.cs index 52cb7bf..350bf9c 100644 --- a/Reseter2/Form1.cs +++ b/Reseter2/Form1.cs @@ -1,4 +1,5 @@ using Reseter2.History; +using Reseter2.Words; using System; using System.Collections.Generic; using System.ComponentModel; @@ -14,7 +15,8 @@ namespace Reseter2 public partial class Form1 : Form { //private FormHistory formHistory; - //public bool Focus; + private bool FocusContext; + private object selectItem; public Form1() { @@ -27,6 +29,61 @@ namespace Reseter2 HistoryList.Update += Update_lb; lb_history.DataSource = HistoryList.Hitem; lb_history.DisplayMember = "ToStr"; + WordsCategoryControl wcc = new WordsCategoryControl(); + flow_words.Controls.Add(wcc); + WordsItemControl wic1 = new WordsItemControl(); + wcc.Add(wic1); + WordsItemControl wic2 = new WordsItemControl(); + wcc.Add(wic2); + WordsItemControl wic3 = new WordsItemControl(); + wcc.Add(wic3); + WordsItemControl wic4 = new WordsItemControl(); + wcc.Add(wic4); + WordsItemControl wic5 = new WordsItemControl(); + wcc.Add(wic5); + WordsItemControl wic6 = new WordsItemControl(); + wcc.Add(wic6); + WordsItemControl wic10 = new WordsItemControl(); + wcc.Add(wic10); + WordsItemControl wic11 = new WordsItemControl(); + wcc.Add(wic11); + WordsItemControl wic12 = new WordsItemControl(); + wcc.Add(wic12); + WordsItemControl wic13 = new WordsItemControl(); + wcc.Add(wic13); + WordsItemControl wic14 = new WordsItemControl(); + wcc.Add(wic14); + WordsItemControl wic21 = new WordsItemControl(); + wcc.Add(wic21); + WordsItemControl wic22 = new WordsItemControl(); + wcc.Add(wic22); + WordsItemControl wic23 = new WordsItemControl(); + wcc.Add(wic23); + WordsItemControl wic24 = new WordsItemControl(); + wcc.Add(wic24); + WordsItemControl wic25 = new WordsItemControl(); + wcc.Add(wic25); + WordsItemControl wic26 = new WordsItemControl(); + wcc.Add(wic26); + WordsItemControl wic30 = new WordsItemControl(); + wcc.Add(wic30); + WordsItemControl wic31 = new WordsItemControl(); + wcc.Add(wic31); + WordsItemControl wic32 = new WordsItemControl(); + wcc.Add(wic32); + WordsItemControl wic33 = new WordsItemControl(); + wcc.Add(wic33); + WordsItemControl wic34 = new WordsItemControl(); + wcc.Add(wic34); + WordsCategoryControl wcc1 = new WordsCategoryControl(); + flow_words.Controls.Add(wcc1); + WordsItemControl wic7 = new WordsItemControl(); + wcc1.Add(wic7); + WordsItemControl wic8 = new WordsItemControl(); + wcc1.Add(wic8); + + + } private void label1_Click(object sender, EventArgs e) @@ -57,5 +114,51 @@ namespace Reseter2 lb_history.DataSource = HistoryList.Hitem; lb_history.DisplayMember = "ToStr"; } + + private void RebootItem_Click(object sender, EventArgs e) + { + + } + + private void sm_RebootItem_Click(object sender, EventArgs e) + { + if(selectItem is HistoryItem historyItem) + { + Reseter.AddTask(historyItem.GetComp()); + } + } + + private void lb_history_MouseMove(object sender, MouseEventArgs e) + { + lb_history.SelectedIndex = lb_history.IndexFromPoint(e.Location); + } + + private void lb_history_MouseLeave(object sender, EventArgs e) + { + + if(!FocusContext) + { + lb_history.SelectedIndex = -1; + } + + } + + private void cm_history_Opening(object sender, CancelEventArgs e) + { + selectItem = lb_history.SelectedItem; + FocusContext = true; + } + + private void lb_history_MouseDown(object sender, MouseEventArgs e) + { + + // lb_history.SelectedIndex = lb_history.IndexFromPoint(e.Location); + } + + private void cm_history_Closed(object sender, ToolStripDropDownClosedEventArgs e) + { + // selectItem = null; + FocusContext = false; + } } } diff --git a/Reseter2/Form1.resx b/Reseter2/Form1.resx index aeff474..227681a 100644 --- a/Reseter2/Form1.resx +++ b/Reseter2/Form1.resx @@ -120,4 +120,7 @@ 122, 17 + + 209, 17 + \ No newline at end of file diff --git a/Reseter2/History/HistoryItem.cs b/Reseter2/History/HistoryItem.cs index ea37ba2..46e83f7 100644 --- a/Reseter2/History/HistoryItem.cs +++ b/Reseter2/History/HistoryItem.cs @@ -36,6 +36,12 @@ namespace Reseter2.History } + public IComp GetComp() + { + return comp; + + } + public void SetEndTime(DateTime endTime) { this.endTime = endTime; diff --git a/Reseter2/PingResult.cs b/Reseter2/PingResult.cs index 925dda9..fb4d937 100644 --- a/Reseter2/PingResult.cs +++ b/Reseter2/PingResult.cs @@ -14,12 +14,22 @@ namespace Reseter2 public int TimeoutPing { get; set; } public IPAddress Ip; public bool TimedOut; + public bool Succes; + public PingResult(long ping, int timeoutPing, IPAddress ip, bool timedOut, bool succes) + { + Ping = ping; + TimeoutPing = timeoutPing; + Ip = ip; + TimedOut = timedOut; + Succes = succes; + } public PingResult(long ping, int timeoutPing, IPAddress ip, bool timedOut) { Ping = ping; TimeoutPing = timeoutPing; Ip = ip; TimedOut = timedOut; + Succes = false; } } } diff --git a/Reseter2/Pinger.cs b/Reseter2/Pinger.cs index dc68b49..be69678 100644 --- a/Reseter2/Pinger.cs +++ b/Reseter2/Pinger.cs @@ -25,6 +25,7 @@ namespace Reseter2 public PingResult PingHost() { bool pingable = false; + bool succes = false; long ping = 0; Ping pinger = null; try @@ -32,6 +33,7 @@ namespace Reseter2 pinger = new Ping(); PingReply reply = pinger.Send(this.NameOrAddress); pingable = reply.Status == IPStatus.TimedOut; + succes = reply.Status == IPStatus.Success; ping = reply.RoundtripTime; Ip = reply.Address; } @@ -47,7 +49,7 @@ namespace Reseter2 } } if (pingable) TimeoutCount++; - return new PingResult(ping, TimeoutCount, Ip, pingable); + return new PingResult(ping, TimeoutCount, Ip, pingable, succes); } } diff --git a/Reseter2/Reseter2.csproj b/Reseter2/Reseter2.csproj index 03106d2..98bb066 100644 --- a/Reseter2/Reseter2.csproj +++ b/Reseter2/Reseter2.csproj @@ -65,7 +65,9 @@ + + @@ -76,6 +78,21 @@ TaskControl.cs + + + + UserControl + + + WordsCategoryControl.cs + + + UserControl + + + WordsItemControl.cs + + Form1.cs @@ -91,6 +108,12 @@ TaskControl.cs + + WordsCategoryControl.cs + + + WordsItemControl.cs + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/Reseter2/StatusCanceled.cs b/Reseter2/StatusCanceled.cs new file mode 100644 index 0000000..37d4112 --- /dev/null +++ b/Reseter2/StatusCanceled.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Reseter2 +{ + internal class StatusCanceled : AStatusTask + { + private PingResult PingResult; + public StatusCanceled(ReseterTask reseterTask) : base(reseterTask) + { + resetertask.SetNameStage("Отмененно"); + resetertask.historyItem.SetEndTime(DateTime.Now); + PingResult = resetertask.Ping(); + reseterTask.sw.Stop(); + } + + public override Task Tick() + { + return Task.FromResult(PingResult); + } + public override void Next() + { + } + public override string GetName() + { + return "Отмененно"; + } + } +} \ No newline at end of file diff --git a/Reseter2/StatusReboot.cs b/Reseter2/StatusReboot.cs index ecb1bb9..06288eb 100644 --- a/Reseter2/StatusReboot.cs +++ b/Reseter2/StatusReboot.cs @@ -15,7 +15,7 @@ namespace Reseter2 private PingResult PingResult = new PingResult(0, 0, null, false); public StatusReboot(ReseterTask reseterTask) : base(reseterTask) { - resetertask.SetNameStage("Отправка в перезагрузки"); + resetertask.SetNameStage("Отправка в перезагрузку"); Shutdown.RestartPC(reseterTask.Comp.GetResetName()); } diff --git a/Reseter2/StatusRebootError.cs b/Reseter2/StatusRebootError.cs new file mode 100644 index 0000000..245e2be --- /dev/null +++ b/Reseter2/StatusRebootError.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Reseter2 +{ + internal class StatusRebootError : AStatusTask + { + private PingResult PingResult = new PingResult(0, 0, null, false); + public StatusRebootError(ReseterTask reseterTask) : base(reseterTask) + { + resetertask.SetNameStage("Ошибка перезагрузки"); + resetertask.historyItem.SetEndTime(DateTime.Now); + reseterTask.sw.Stop(); + } + + public override Task Tick() + { + return Task.FromResult(PingResult); + } + public override void Next() + { + } + public override string GetName() + { + return "Ошибка"; + } + } +} diff --git a/Reseter2/StatusRebooting.cs b/Reseter2/StatusRebooting.cs index 5286d42..45e7921 100644 --- a/Reseter2/StatusRebooting.cs +++ b/Reseter2/StatusRebooting.cs @@ -24,7 +24,7 @@ namespace Reseter2 } public override void Next() { - if (PingResult.TimedOut == false) + if (PingResult.Succes) { TimeCount++; } diff --git a/Reseter2/StausPreReboot.cs b/Reseter2/StausPreReboot.cs index 1d40e6c..a4072a8 100644 --- a/Reseter2/StausPreReboot.cs +++ b/Reseter2/StausPreReboot.cs @@ -9,7 +9,7 @@ namespace Reseter2 { internal class StatusPreReboot : AStatusTask { - private int time; + private int timeOut; private PingResult PingResult = new PingResult(0,0,null, false); public StatusPreReboot(ReseterTask reseterTask) : base(reseterTask) { @@ -19,7 +19,7 @@ namespace Reseter2 public override Task Tick() { - time++; + PingResult = resetertask.Ping(); return Task.FromResult(PingResult); // return resetertask.DataContrl(pingResult.Ping.ToString(), pingResult.Ping.ToString()); @@ -27,12 +27,21 @@ namespace Reseter2 } public override void Next() { - if (PingResult.TimedOut == false) - { + if (PingResult.Succes) + { resetertask.StatusTask = new StatusReboot(resetertask); HistoryList.Updated(); + return; + } + else + { + timeOut++; + } + if(timeOut > 2) + { + resetertask.StatusTask = new StatusRebootError(resetertask); + HistoryList.Updated(); } - } public override string GetName() diff --git a/Reseter2/Words/IWordsItem.cs b/Reseter2/Words/IWordsItem.cs new file mode 100644 index 0000000..138abdd --- /dev/null +++ b/Reseter2/Words/IWordsItem.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Reseter2.Words +{ + internal abstract class IWordsItem + { + public abstract bool Cheked(); + public abstract string GetName(); + public IWordsItem() + { + + } + + + + + } +} diff --git a/Reseter2/Words/WordsCategory.cs b/Reseter2/Words/WordsCategory.cs new file mode 100644 index 0000000..9cf9c29 --- /dev/null +++ b/Reseter2/Words/WordsCategory.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Reseter2.Words +{ + internal class WordsCategory : IWordsItem + { + private string Name; + private bool cheked; + + public override string GetName() + { + return Name; + } + public override bool Cheked() + { + return cheked; + } + } +} diff --git a/Reseter2/Words/WordsCategoryControl.Designer.cs b/Reseter2/Words/WordsCategoryControl.Designer.cs new file mode 100644 index 0000000..32b9e6e --- /dev/null +++ b/Reseter2/Words/WordsCategoryControl.Designer.cs @@ -0,0 +1,113 @@ +namespace Reseter2.Words +{ + partial class WordsCategoryControl + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + this.Select = new System.Windows.Forms.CheckBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.flow_wordsItem = new System.Windows.Forms.FlowLayoutPanel(); + this.SuspendLayout(); + // + // Select + // + this.Select.AutoSize = true; + this.Select.Location = new System.Drawing.Point(6, 2); + this.Select.Name = "Select"; + this.Select.Size = new System.Drawing.Size(15, 14); + this.Select.TabIndex = 1; + this.Select.UseVisualStyleBackColor = true; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(3, 5); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(367, 13); + this.label2.TabIndex = 0; + this.label2.Text = "____________________________________________________________"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(23, 2); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(88, 13); + this.label3.TabIndex = 2; + this.label3.Text = "Вебинарные ПК"; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label1.Location = new System.Drawing.Point(366, -4); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(30, 29); + this.label1.TabIndex = 3; + this.label1.Text = "⟱"; + this.label1.Click += new System.EventHandler(this.label1_Click); + // + // flow_wordsItem + // + this.flow_wordsItem.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.flow_wordsItem.AutoSize = true; + this.flow_wordsItem.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flow_wordsItem.Location = new System.Drawing.Point(0, 20); + this.flow_wordsItem.Name = "flow_wordsItem"; + this.flow_wordsItem.Size = new System.Drawing.Size(403, 5); + this.flow_wordsItem.TabIndex = 4; + this.flow_wordsItem.WrapContents = false; + // + // WordsCategoryControl + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.AutoSize = true; + this.Controls.Add(this.flow_wordsItem); + this.Controls.Add(this.Select); + this.Controls.Add(this.label1); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Name = "WordsCategoryControl"; + this.Size = new System.Drawing.Size(403, 25); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.CheckBox Select; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.FlowLayoutPanel flow_wordsItem; + } +} diff --git a/Reseter2/Words/WordsCategoryControl.cs b/Reseter2/Words/WordsCategoryControl.cs new file mode 100644 index 0000000..a02fc3f --- /dev/null +++ b/Reseter2/Words/WordsCategoryControl.cs @@ -0,0 +1,32 @@ +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 Reseter2.Words +{ + [DefaultEvent(nameof(WordsCategoryControl))] + partial class WordsCategoryControl : UserControl + { + public WordsCategoryControl() + { + InitializeComponent(); + } + + public void Add(WordsItemControl wic) + { + flow_wordsItem.Controls.Add(wic); + } + + private void label1_Click(object sender, EventArgs e) + { + flow_wordsItem.Visible = !flow_wordsItem.Visible; + //flow_wordsItem.s + } + } +} diff --git a/Reseter2/Words/WordsCategoryControl.resx b/Reseter2/Words/WordsCategoryControl.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Reseter2/Words/WordsCategoryControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Reseter2/Words/WordsItemControl.Designer.cs b/Reseter2/Words/WordsItemControl.Designer.cs new file mode 100644 index 0000000..fe8f9cc --- /dev/null +++ b/Reseter2/Words/WordsItemControl.Designer.cs @@ -0,0 +1,132 @@ +namespace Reseter2.Words +{ + partial class WordsItemControl + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.label1 = new System.Windows.Forms.Label(); + this.lb_name = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.lb_ip = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(8, 6); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(15, 14); + this.checkBox1.TabIndex = 0; + this.checkBox1.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(31, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(47, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Имя ПК"; + // + // lb_name + // + this.lb_name.AutoSize = true; + this.lb_name.Location = new System.Drawing.Point(84, 0); + this.lb_name.Name = "lb_name"; + this.lb_name.Size = new System.Drawing.Size(65, 13); + this.lb_name.TabIndex = 2; + this.lb_name.Text = "1MA001234"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(183, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(50, 13); + this.label2.TabIndex = 3; + this.label2.Text = "IP адрес"; + // + // lb_ip + // + this.lb_ip.AutoSize = true; + this.lb_ip.Location = new System.Drawing.Point(239, 0); + this.lb_ip.Name = "lb_ip"; + this.lb_ip.Size = new System.Drawing.Size(70, 13); + this.lb_ip.TabIndex = 4; + this.lb_ip.Text = "10,3,100,252"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(31, 15); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(57, 13); + this.label3.TabIndex = 5; + this.label3.Text = "Описание"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(88, 15); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(220, 13); + this.label4.TabIndex = 6; + this.label4.Text = "Контролер оповещения физлица главный"; + // + // WordsItemControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.lb_ip); + this.Controls.Add(this.label2); + this.Controls.Add(this.lb_name); + this.Controls.Add(this.label1); + this.Controls.Add(this.checkBox1); + this.Name = "WordsItemControl"; + this.Size = new System.Drawing.Size(371, 27); + this.Load += new System.EventHandler(this.WordsItemControl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label lb_name; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label lb_ip; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + } +} diff --git a/Reseter2/Words/WordsItemControl.cs b/Reseter2/Words/WordsItemControl.cs new file mode 100644 index 0000000..b0e8466 --- /dev/null +++ b/Reseter2/Words/WordsItemControl.cs @@ -0,0 +1,29 @@ +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 Reseter2.Words +{ + + [DefaultEvent(nameof(WordsItemControl))] + public partial class WordsItemControl : UserControl + { + + public WordsItemControl() + { + InitializeComponent(); + } + + private void WordsItemControl_Load(object sender, EventArgs e) + { + + } + + } +} diff --git a/Reseter2/Words/WordsItemControl.resx b/Reseter2/Words/WordsItemControl.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Reseter2/Words/WordsItemControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Reseter2/Words/WordsList.cs b/Reseter2/Words/WordsList.cs new file mode 100644 index 0000000..55c0b38 --- /dev/null +++ b/Reseter2/Words/WordsList.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Reseter2.Words +{ + static class WordsList + { + private static List wordsItems = new List(); + private static void Add() + { + + } + } +} diff --git a/Reseter2/reseter.cs b/Reseter2/reseter.cs index 646b386..15db81b 100644 --- a/Reseter2/reseter.cs +++ b/Reseter2/reseter.cs @@ -52,6 +52,7 @@ namespace Reseter2 public static async void Clear(ReseterTask reseterTask, TaskControl taskControl) { + reseterTask.StatusTask = new StatusCanceled(reseterTask); reseterTask.historyItem.SetEndTime(DateTime.Now); HistoryList.Updated(); flow_conteiner.Controls.Remove(taskControl);