diff --git a/Remontor/.vs/Remontor/FileContentIndex/4a6b48c5-aa51-494a-8803-f41aa2388634.vsidx b/Remontor/.vs/Remontor/FileContentIndex/4a6b48c5-aa51-494a-8803-f41aa2388634.vsidx new file mode 100644 index 0000000..21eab0f Binary files /dev/null and b/Remontor/.vs/Remontor/FileContentIndex/4a6b48c5-aa51-494a-8803-f41aa2388634.vsidx differ diff --git a/Remontor/.vs/Remontor/FileContentIndex/83c16984-46f9-4650-894d-557be5ae12e9.vsidx b/Remontor/.vs/Remontor/FileContentIndex/83c16984-46f9-4650-894d-557be5ae12e9.vsidx new file mode 100644 index 0000000..3662aa8 Binary files /dev/null and b/Remontor/.vs/Remontor/FileContentIndex/83c16984-46f9-4650-894d-557be5ae12e9.vsidx differ diff --git a/Remontor/.vs/Remontor/FileContentIndex/84e6eb22-43c3-4722-9b8d-e0b844fd8bad.vsidx b/Remontor/.vs/Remontor/FileContentIndex/84e6eb22-43c3-4722-9b8d-e0b844fd8bad.vsidx new file mode 100644 index 0000000..d03cef3 Binary files /dev/null and b/Remontor/.vs/Remontor/FileContentIndex/84e6eb22-43c3-4722-9b8d-e0b844fd8bad.vsidx differ diff --git a/Remontor/.vs/Remontor/FileContentIndex/d9d059a6-7f60-48eb-8bdb-c696a14ce270.vsidx b/Remontor/.vs/Remontor/FileContentIndex/d9d059a6-7f60-48eb-8bdb-c696a14ce270.vsidx new file mode 100644 index 0000000..84a7d7b Binary files /dev/null and b/Remontor/.vs/Remontor/FileContentIndex/d9d059a6-7f60-48eb-8bdb-c696a14ce270.vsidx differ diff --git a/Remontor/.vs/Remontor/v17/.suo b/Remontor/.vs/Remontor/v17/.suo index 33e2121..fb42d47 100644 Binary files a/Remontor/.vs/Remontor/v17/.suo and b/Remontor/.vs/Remontor/v17/.suo differ diff --git a/Remontor/Connector/DobleMonFull.cs b/Remontor/Connector/DobleMonFull.cs index e26ab8b..094d748 100644 --- a/Remontor/Connector/DobleMonFull.cs +++ b/Remontor/Connector/DobleMonFull.cs @@ -35,7 +35,7 @@ namespace Remontor.Connector SConnector.FormMain.Width = 3840; SConnector.FormMain.Height = 1040; SConnector.FormMain.Location = new System.Drawing.Point(0, 0); - MoveWindow(Proc.MainWindowHandle, View.Bounds.X, View.Bounds.Y - 4, View.Bounds.Width, View.Bounds.Height, true); + MoveWindow(Proc.MainWindowHandle, View.Bounds.X, View.Bounds.Y - 0, View.Bounds.Width, View.Bounds.Height, true); } public override IModeMon Change(IModeMon Mode) diff --git a/Remontor/Connector/OneMon.cs b/Remontor/Connector/OneMon.cs index c428001..d8c5389 100644 --- a/Remontor/Connector/OneMon.cs +++ b/Remontor/Connector/OneMon.cs @@ -16,7 +16,7 @@ namespace Remontor.Connector public OneMon() { } public override void Resize(Process Proc, Control View) { - MoveWindow(Proc.MainWindowHandle, View.Bounds.X, View.Bounds.Y - 4, View.Bounds.Width, View.Bounds.Height, true); + MoveWindow(Proc.MainWindowHandle, View.Bounds.X, View.Bounds.Y + 9, View.Bounds.Width, View.Bounds.Height, true); } public override IModeMon Change(IModeMon Mode) { diff --git a/Remontor/Finder/Finder.Designer.cs b/Remontor/Finder/Finder.Designer.cs index ae3e3a4..a9cf184 100644 --- a/Remontor/Finder/Finder.Designer.cs +++ b/Remontor/Finder/Finder.Designer.cs @@ -30,17 +30,9 @@ { this.CompNameLB = new System.Windows.Forms.TextBox(); this.SeaherPanel = new System.Windows.Forms.FlowLayoutPanel(); + this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.ConnectBtn = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); - this.button4 = new System.Windows.Forms.Button(); - this.button5 = new System.Windows.Forms.Button(); - this.sessionItemControl1 = new Remontor.SessionItemControl(); - this.sessionItemControl2 = new Remontor.SessionItemControl(); - this.sessionItemControl3 = new Remontor.SessionItemControl(); - this.sessionItemControl4 = new Remontor.SessionItemControl(); this.SeaherPanel.SuspendLayout(); this.SuspendLayout(); // @@ -48,39 +40,49 @@ // this.CompNameLB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.CompNameLB.Location = new System.Drawing.Point(125, 12); + this.CompNameLB.Location = new System.Drawing.Point(65, 12); this.CompNameLB.Name = "CompNameLB"; - this.CompNameLB.Size = new System.Drawing.Size(602, 20); + this.CompNameLB.Size = new System.Drawing.Size(210, 20); this.CompNameLB.TabIndex = 0; this.CompNameLB.TextChanged += new System.EventHandler(this.CompNameLB_TextChanged); + this.CompNameLB.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CompNameLB_KeyDown); // // SeaherPanel // + this.SeaherPanel.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.SeaherPanel.AutoScroll = true; this.SeaherPanel.BackColor = System.Drawing.SystemColors.Window; this.SeaherPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.SeaherPanel.Controls.Add(this.sessionItemControl1); - this.SeaherPanel.Controls.Add(this.sessionItemControl2); - this.SeaherPanel.Controls.Add(this.sessionItemControl4); - this.SeaherPanel.Controls.Add(this.sessionItemControl3); - this.SeaherPanel.Dock = System.Windows.Forms.DockStyle.Bottom; - this.SeaherPanel.Location = new System.Drawing.Point(0, 65); + this.SeaherPanel.Controls.Add(this.label2); + this.SeaherPanel.Location = new System.Drawing.Point(0, 39); this.SeaherPanel.Name = "SeaherPanel"; - this.SeaherPanel.Size = new System.Drawing.Size(866, 385); + this.SeaherPanel.Size = new System.Drawing.Size(384, 411); this.SeaherPanel.TabIndex = 1; // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(3, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(88, 13); + this.label2.TabIndex = 0; + this.label2.Text = "Введите запрос"; + // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(31, 15); + this.label1.Location = new System.Drawing.Point(12, 15); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(88, 13); + this.label1.Size = new System.Drawing.Size(47, 13); this.label1.TabIndex = 2; - this.label1.Text = "Введите запрос"; + this.label1.Text = "Имя ПК"; // // ConnectBtn // this.ConnectBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ConnectBtn.Location = new System.Drawing.Point(733, 10); + this.ConnectBtn.Location = new System.Drawing.Point(281, 10); this.ConnectBtn.Name = "ConnectBtn"; this.ConnectBtn.Size = new System.Drawing.Size(91, 23); this.ConnectBtn.TabIndex = 3; @@ -88,89 +90,11 @@ this.ConnectBtn.UseVisualStyleBackColor = true; this.ConnectBtn.Click += new System.EventHandler(this.ConnectBtn_Click); // - // button1 - // - this.button1.Location = new System.Drawing.Point(607, 36); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(121, 23); - this.button1.TabIndex = 4; - this.button1.Text = "Подключиться по IP"; - this.button1.UseVisualStyleBackColor = true; - // - // button2 - // - this.button2.Location = new System.Drawing.Point(472, 36); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(129, 23); - this.button2.TabIndex = 5; - this.button2.Text = "Подключение по RDP"; - this.button2.UseVisualStyleBackColor = true; - // - // button3 - // - this.button3.Location = new System.Drawing.Point(329, 36); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(137, 23); - this.button3.TabIndex = 6; - this.button3.Text = "Открыть в проводнике"; - this.button3.UseVisualStyleBackColor = true; - // - // button4 - // - this.button4.Location = new System.Drawing.Point(223, 36); - this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(100, 23); - this.button4.TabIndex = 7; - this.button4.Text = "Открыть реестр "; - this.button4.UseVisualStyleBackColor = true; - // - // button5 - // - this.button5.Location = new System.Drawing.Point(21, 36); - this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(196, 23); - this.button5.TabIndex = 8; - this.button5.Text = "Открыть управление комьютером"; - this.button5.UseVisualStyleBackColor = true; - // - // sessionItemControl1 - // - this.sessionItemControl1.Location = new System.Drawing.Point(3, 3); - this.sessionItemControl1.Name = "sessionItemControl1"; - this.sessionItemControl1.Size = new System.Drawing.Size(274, 55); - this.sessionItemControl1.TabIndex = 0; - // - // sessionItemControl2 - // - this.sessionItemControl2.Location = new System.Drawing.Point(283, 3); - this.sessionItemControl2.Name = "sessionItemControl2"; - this.sessionItemControl2.Size = new System.Drawing.Size(274, 55); - this.sessionItemControl2.TabIndex = 1; - // - // sessionItemControl3 - // - this.sessionItemControl3.Location = new System.Drawing.Point(3, 64); - this.sessionItemControl3.Name = "sessionItemControl3"; - this.sessionItemControl3.Size = new System.Drawing.Size(274, 55); - this.sessionItemControl3.TabIndex = 2; - // - // sessionItemControl4 - // - this.sessionItemControl4.Location = new System.Drawing.Point(563, 3); - this.sessionItemControl4.Name = "sessionItemControl4"; - this.sessionItemControl4.Size = new System.Drawing.Size(274, 55); - this.sessionItemControl4.TabIndex = 3; - // // Finder // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(866, 450); - this.Controls.Add(this.button5); - this.Controls.Add(this.button4); - this.Controls.Add(this.button3); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); + this.ClientSize = new System.Drawing.Size(384, 450); this.Controls.Add(this.ConnectBtn); this.Controls.Add(this.label1); this.Controls.Add(this.SeaherPanel); @@ -178,6 +102,7 @@ this.Name = "Finder"; this.Text = "Новое подключение"; this.SeaherPanel.ResumeLayout(false); + this.SeaherPanel.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -189,14 +114,6 @@ private System.Windows.Forms.FlowLayoutPanel SeaherPanel; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button ConnectBtn; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Button button3; - private System.Windows.Forms.Button button4; - private System.Windows.Forms.Button button5; - private SessionItemControl sessionItemControl1; - private SessionItemControl sessionItemControl2; - private SessionItemControl sessionItemControl3; - private SessionItemControl sessionItemControl4; + private System.Windows.Forms.Label label2; } } \ No newline at end of file diff --git a/Remontor/Finder/Finder.cs b/Remontor/Finder/Finder.cs index 339b6b1..ad17ee9 100644 --- a/Remontor/Finder/Finder.cs +++ b/Remontor/Finder/Finder.cs @@ -14,6 +14,7 @@ namespace Remontor.Finder { internal partial class Finder : Form { + private SessionItemControl SelectedItem; private bool StopRefreshSeacher = false; private int PreSelected = -1; public Finder() @@ -41,36 +42,85 @@ namespace Remontor.Finder public void cb_comp_ResultUpdate(List Items) { PreSelected = -1; - int prewY = 0; - int CountY = 1; + SelectedItem = null; SeaherPanel.Controls.Clear(); - foreach (Control control in Items) + int countItem = 0; + foreach (ISeacherResult item in Items) { - + SessionItemControl itemControl = new SessionItemControl(item, UpdateActiv, countItem++); + SeaherPanel.Controls.Add(itemControl); + } - foreach (Control control in SeaherPanel.Controls) + + + + + } + + private void UpdateActiv(SessionItemControl sessionItem) + { + if(SelectedItem != null) SelectedItem.SelectActiv(null); + if(PreSelected > -1)((SessionItemControl)SeaherPanel.Controls[PreSelected]).SelectPreActiv(null); + SelectedItem = sessionItem; + PreSelected = sessionItem.SelectActiv(sessionItem); + StopRefreshSeacher = true; + CompNameLB.Focus(); + CompNameLB.Text = sessionItem.seacherResult.ResultString(); + CompNameLB.Select(CompNameLB.Text.Length, 0); + StopRefreshSeacher = false; + } + + private void CompNameLB_KeyDown(object sender, KeyEventArgs e) + { + switch (e.KeyValue) { - if (control.Bounds.Y == prewY) - { - CountY++; - } - else if(prewY > 0) - { + case 40: + if (PreSelected < SeaherPanel.Controls.Count - 1) + { + SelectedItem = null; + if (PreSelected > -1) ((SessionItemControl)SeaherPanel.Controls[PreSelected]).SelectPreActiv(null); + ++PreSelected; + SeaherPanel.ScrollControlIntoView(SeaherPanel.Controls[PreSelected]); + ((SessionItemControl)SeaherPanel.Controls[PreSelected]).SelectPreActiv((SessionItemControl)SeaherPanel.Controls[PreSelected]); + } + e.SuppressKeyPress = true; + break; + case 38: + if (PreSelected > 0) + { + SelectedItem = null; + if (PreSelected > -1) ((SessionItemControl)SeaherPanel.Controls[PreSelected]).SelectPreActiv(null); + --PreSelected; + SeaherPanel.ScrollControlIntoView(SeaherPanel.Controls[PreSelected]); + ((SessionItemControl)SeaherPanel.Controls[PreSelected]).SelectPreActiv((SessionItemControl)SeaherPanel.Controls[PreSelected]); + } + + e.SuppressKeyPress = true; + //ListComp.Refresh(); + break; + case 13: + if ((SessionItemControl)SeaherPanel.Controls[PreSelected] == SelectedItem) + { + + //bt_reset_Click(null, null); + break; + } + if (PreSelected >= 0) + { + if (SelectedItem != null) SelectedItem.SelectActiv(null); + SelectedItem = (SessionItemControl)SeaherPanel.Controls[PreSelected]; + ((SessionItemControl)SeaherPanel.Controls[PreSelected]).SelectActiv((SessionItemControl)SeaherPanel.Controls[PreSelected]); + StopRefreshSeacher = true; + CompNameLB.Focus(); + CompNameLB.Text = ((SessionItemControl)SeaherPanel.Controls[PreSelected]).seacherResult.ResultString(); + CompNameLB.Select(CompNameLB.Text.Length, 0); + StopRefreshSeacher = false; + + e.SuppressKeyPress = true; + + } break; - } - prewY = control.Bounds.Y; } - - // SeaherPanel. - - //ListComp.ItemHeight = itemHeight; - //ListComp.Height = ListComp.ItemHeight * (Items.Count + 1); - //ListComp.Items.Clear(); - //ListComp.Items.AddRange(Items.ToArray()); - //ListComp.Enabled = enable; - - // ListComp.Visible = true; - } } diff --git a/Remontor/Form1.Designer.cs b/Remontor/Form1.Designer.cs index 488829f..3845a0c 100644 --- a/Remontor/Form1.Designer.cs +++ b/Remontor/Form1.Designer.cs @@ -29,10 +29,10 @@ private void InitializeComponent() { this.panel3 = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); this.flowConteinerSetting1 = new Remontor.FlowConteinerSetting(); this.flowContainerWords1 = new Remontor.FlowContainerWords(); this.flowContainer1 = new Remontor.FlowContainer(); - this.label1 = new System.Windows.Forms.Label(); this.barSessionControl1 = new Remontor.BarSessionControl(); this.panel3.SuspendLayout(); this.SuspendLayout(); @@ -48,6 +48,16 @@ this.panel3.Size = new System.Drawing.Size(1094, 706); this.panel3.TabIndex = 1; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Dock = System.Windows.Forms.DockStyle.Fill; + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(151, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Нету активныйх соединений"; + // // flowConteinerSetting1 // this.flowConteinerSetting1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -86,16 +96,6 @@ this.flowContainer1.TabIndex = 1; this.flowContainer1.Visible = false; // - // label1 - // - this.label1.AutoSize = true; - this.label1.Dock = System.Windows.Forms.DockStyle.Fill; - this.label1.Location = new System.Drawing.Point(0, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(151, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Нету активныйх соединений"; - // // barSessionControl1 // this.barSessionControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) diff --git a/Remontor/Properties/Resources.Designer.cs b/Remontor/Properties/Resources.Designer.cs index 5cb18bd..3c6a637 100644 --- a/Remontor/Properties/Resources.Designer.cs +++ b/Remontor/Properties/Resources.Designer.cs @@ -250,6 +250,16 @@ namespace Remontor.Properties { } } + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ping_test { + get { + object obj = ResourceManager.GetObject("ping_test", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Поиск локализованного ресурса типа System.Drawing.Bitmap. /// diff --git a/Remontor/Properties/Resources.resx b/Remontor/Properties/Resources.resx index 7c904e9..a2d326f 100644 --- a/Remontor/Properties/Resources.resx +++ b/Remontor/Properties/Resources.resx @@ -124,6 +124,9 @@ ..\Resources\developer_mode_tv_24dp_48752C_FILL0_wght400_GRAD0_opsz24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\add_circle_24dp_19C016_FILL0_wght400_GRAD0_opsz24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\2_size.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -208,7 +211,7 @@ ..\Resources\reconnect.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\add_circle_24dp_19C016_FILL0_wght400_GRAD0_opsz24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ping_test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Remontor/Remontor.csproj b/Remontor/Remontor.csproj index d6f18fc..e1f185e 100644 --- a/Remontor/Remontor.csproj +++ b/Remontor/Remontor.csproj @@ -351,5 +351,8 @@ + + + \ No newline at end of file diff --git a/Remontor/Resources/ping_test.png b/Remontor/Resources/ping_test.png new file mode 100644 index 0000000..5a36c9d Binary files /dev/null and b/Remontor/Resources/ping_test.png differ diff --git a/Remontor/Seacher/HistoryResult.cs b/Remontor/Seacher/HistoryResult.cs index 8e976b4..95c1c33 100644 --- a/Remontor/Seacher/HistoryResult.cs +++ b/Remontor/Seacher/HistoryResult.cs @@ -20,9 +20,38 @@ namespace Remontor.Seacher LastConnect = lastConnect; } + public IComp GetComp() { + return Comp; + } + + public DateTime GetLastConnect() + { + return LastConnect; + } public string toString() { return Comp.GetNetNameStr(); } + + public IComp Result() + { + return Comp; + } + + public string ResultString() + { + string buf; + if (Comp.GetName() == null) + { + buf = Comp.GetNetNameStr(); + } + else + { + buf = Comp.GetName(); + if (Comp.GetNetNameStr() != null) buf += "(" + Comp.GetNetNameStr() + ")"; + + } + return buf; + } } } diff --git a/Remontor/Seacher/ISeacherResult.cs b/Remontor/Seacher/ISeacherResult.cs index b876e97..d2ed4b3 100644 --- a/Remontor/Seacher/ISeacherResult.cs +++ b/Remontor/Seacher/ISeacherResult.cs @@ -8,6 +8,8 @@ namespace Remontor.Seacher { internal interface ISeacherResult { - string toString(); + string toString(); + IComp Result(); + string ResultString(); } } diff --git a/Remontor/Seacher/NoResult.cs b/Remontor/Seacher/NoResult.cs index d56a54e..d746148 100644 --- a/Remontor/Seacher/NoResult.cs +++ b/Remontor/Seacher/NoResult.cs @@ -17,7 +17,17 @@ namespace Remontor.Seacher public string toString() { - return ""; + return Status; + } + + public IComp Result() + { + return null; + } + + public string ResultString() + { + return Status; } } } diff --git a/Remontor/Seacher/SeahcLocal.cs b/Remontor/Seacher/SeahcLocal.cs index 65cd94a..16e0dc0 100644 --- a/Remontor/Seacher/SeahcLocal.cs +++ b/Remontor/Seacher/SeahcLocal.cs @@ -85,7 +85,7 @@ namespace Remontor.Seacher ++i; enable = true; - if (i > 6) return result; + if (i > 20) return result; } } diff --git a/Remontor/SessionItemControl.Designer.cs b/Remontor/SessionItemControl.Designer.cs index 9f81ccf..ec4f12e 100644 --- a/Remontor/SessionItemControl.Designer.cs +++ b/Remontor/SessionItemControl.Designer.cs @@ -28,60 +28,90 @@ /// private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.LbNetNameStatic = new System.Windows.Forms.Label(); + this.LbData = new System.Windows.Forms.Label(); + this.LbName = new System.Windows.Forms.Label(); + this.LbNetName = new System.Windows.Forms.Label(); + this.PbPerson = new System.Windows.Forms.PictureBox(); + this.PPingStat = new System.Windows.Forms.Panel(); + ((System.ComponentModel.ISupportInitialize)(this.PbPerson)).BeginInit(); this.SuspendLayout(); // - // label1 + // LbNetNameStatic // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(57, 20); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(47, 13); - this.label1.TabIndex = 1; - this.label1.Text = "Имя ПК"; + this.LbNetNameStatic.AutoSize = true; + this.LbNetNameStatic.Location = new System.Drawing.Point(57, 20); + this.LbNetNameStatic.Name = "LbNetNameStatic"; + this.LbNetNameStatic.Size = new System.Drawing.Size(47, 13); + this.LbNetNameStatic.TabIndex = 1; + this.LbNetNameStatic.Text = "Имя ПК"; + this.LbNetNameStatic.Click += new System.EventHandler(this.SessionItemControl_Click); // - // label2 + // LbData // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(57, 33); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(57, 13); - this.label2.TabIndex = 2; - this.label2.Text = "LastLogon"; + this.LbData.AutoSize = true; + this.LbData.Location = new System.Drawing.Point(57, 33); + this.LbData.Name = "LbData"; + this.LbData.Size = new System.Drawing.Size(57, 13); + this.LbData.TabIndex = 2; + this.LbData.Text = "LastLogon"; + this.LbData.Click += new System.EventHandler(this.SessionItemControl_Click); // - // label3 + // LbName // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(57, 7); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(141, 13); - this.label3.TabIndex = 3; - this.label3.Text = "Котов Кирилл Николаевич"; + this.LbName.AutoSize = true; + this.LbName.Location = new System.Drawing.Point(57, 7); + this.LbName.Name = "LbName"; + this.LbName.Size = new System.Drawing.Size(141, 13); + this.LbName.TabIndex = 3; + this.LbName.Text = "Котов Кирилл Николаевич"; + this.LbName.Click += new System.EventHandler(this.SessionItemControl_Click); // - // pictureBox1 + // LbNetName // - this.pictureBox1.Image = global::Remontor.Properties.Resources.Person; - this.pictureBox1.Location = new System.Drawing.Point(3, 3); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(48, 48); - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; + this.LbNetName.AutoSize = true; + this.LbNetName.Location = new System.Drawing.Point(110, 20); + this.LbNetName.Name = "LbNetName"; + this.LbNetName.Size = new System.Drawing.Size(10, 13); + this.LbNetName.TabIndex = 4; + this.LbNetName.Text = "-"; + this.LbNetName.Click += new System.EventHandler(this.SessionItemControl_Click); + // + // PbPerson + // + this.PbPerson.Image = global::Remontor.Properties.Resources.Person; + this.PbPerson.Location = new System.Drawing.Point(3, 3); + this.PbPerson.Name = "PbPerson"; + this.PbPerson.Size = new System.Drawing.Size(48, 48); + this.PbPerson.TabIndex = 0; + this.PbPerson.TabStop = false; + this.PbPerson.Click += new System.EventHandler(this.SessionItemControl_Click); + // + // PPingStat + // + this.PPingStat.BackColor = System.Drawing.Color.Gold; + this.PPingStat.Location = new System.Drawing.Point(43, 43); + this.PPingStat.Name = "PPingStat"; + this.PPingStat.Size = new System.Drawing.Size(8, 8); + this.PPingStat.TabIndex = 5; + this.PPingStat.Click += new System.EventHandler(this.SessionItemControl_Click); // // SessionItemControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Controls.Add(this.pictureBox1); + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.PPingStat); + this.Controls.Add(this.LbNetName); + this.Controls.Add(this.LbName); + this.Controls.Add(this.LbData); + this.Controls.Add(this.LbNetNameStatic); + this.Controls.Add(this.PbPerson); + this.Margin = new System.Windows.Forms.Padding(1); this.Name = "SessionItemControl"; - this.Size = new System.Drawing.Size(274, 55); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.Size = new System.Drawing.Size(353, 55); + this.Click += new System.EventHandler(this.SessionItemControl_Click); + ((System.ComponentModel.ISupportInitialize)(this.PbPerson)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -89,9 +119,11 @@ #endregion - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.PictureBox PbPerson; + private System.Windows.Forms.Label LbNetNameStatic; + private System.Windows.Forms.Label LbData; + private System.Windows.Forms.Label LbName; + private System.Windows.Forms.Label LbNetName; + private System.Windows.Forms.Panel PPingStat; } } diff --git a/Remontor/SessionItemControl.cs b/Remontor/SessionItemControl.cs index 307211c..0572841 100644 --- a/Remontor/SessionItemControl.cs +++ b/Remontor/SessionItemControl.cs @@ -1,8 +1,10 @@ -using System; +using Remontor.Seacher; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; +using System.Drawing.Text; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,11 +12,94 @@ using System.Windows.Forms; namespace Remontor { - public partial class SessionItemControl : UserControl + internal partial class SessionItemControl : UserControl { + private bool PreActive = false; + private IComp Comp; + public delegate void SelectDelegat(SessionItemControl sessionItem); + event SelectDelegat Select; + private int Index; + public ISeacherResult seacherResult; public SessionItemControl() { InitializeComponent(); } + + public SessionItemControl(ISeacherResult seacherResult, SelectDelegat UpdateAct, int index) + { + InitializeComponent(); + this.seacherResult = seacherResult; + if (seacherResult is NoResult) + { + NoResult result = (NoResult) seacherResult; + this.Dock = DockStyle.Top; + LbName.Location = this.Location; + LbName.Text = result.toString(); + + PbPerson.Visible = false; + LbData.Visible = false; + LbNetName.Visible = false; + LbNetNameStatic.Visible = false; + PPingStat.Visible = false; + + } + else if(seacherResult is HistoryResult) + { + HistoryResult result = (HistoryResult) seacherResult; + LbName.Text = result.GetComp().GetName(); + LbNetName.Text = result.GetComp().GetNetName(); + LbData.Text = "last connect:" + result.GetLastConnect(); + Select += UpdateAct; + Index = index; + + + } + } + public void SelectPreActiv(SessionItemControl control) + { + if (control == this) + { + PreActive = true; + this.BackColor = SystemColors.Control; + // this.BackColor = SystemColors.GradientInactiveCaption; + } + else + { + PreActive = false; + this.BackColor = SystemColors.Window; + } + } + + public int SelectActiv(SessionItemControl control) + { + if (control == this) + { + PreActive = true; + // this.BackColor = SystemColors.Control; + this.BackColor = SystemColors.GradientInactiveCaption; + } + else + { + PreActive = false; + this.BackColor = SystemColors.Window; + } + return Index; + } + + private void SessionItemControl_KeyDown(object sender, KeyEventArgs e) + { + + System.Console.WriteLine("click"); + } + + private void SessionItemControl_Click(object sender, EventArgs e) + { + if (!(seacherResult is NoResult)) + { + Select(this); + } + + + } } } diff --git a/Remontor/bin/Debug/Remontor.exe b/Remontor/bin/Debug/Remontor.exe index c0687ea..cc4cb20 100644 Binary files a/Remontor/bin/Debug/Remontor.exe and b/Remontor/bin/Debug/Remontor.exe differ diff --git a/Remontor/bin/Debug/Remontor.pdb b/Remontor/bin/Debug/Remontor.pdb index dacfc07..011c88b 100644 Binary files a/Remontor/bin/Debug/Remontor.pdb and b/Remontor/bin/Debug/Remontor.pdb differ diff --git a/Remontor/bin/Debug/res.dat b/Remontor/bin/Debug/res.dat index 0090de6..9282053 100644 Binary files a/Remontor/bin/Debug/res.dat and b/Remontor/bin/Debug/res.dat differ diff --git a/Remontor/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Remontor/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 4d2f2c1..0a18852 100644 Binary files a/Remontor/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/Remontor/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Remontor/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Remontor/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 79eda44..2d3f4ec 100644 Binary files a/Remontor/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/Remontor/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Remontor/obj/Debug/Remontor.Properties.Resources.resources b/Remontor/obj/Debug/Remontor.Properties.Resources.resources index 1a97759..e8907c9 100644 Binary files a/Remontor/obj/Debug/Remontor.Properties.Resources.resources and b/Remontor/obj/Debug/Remontor.Properties.Resources.resources differ diff --git a/Remontor/obj/Debug/Remontor.csproj.GenerateResource.cache b/Remontor/obj/Debug/Remontor.csproj.GenerateResource.cache index 45e3641..6e6417f 100644 Binary files a/Remontor/obj/Debug/Remontor.csproj.GenerateResource.cache and b/Remontor/obj/Debug/Remontor.csproj.GenerateResource.cache differ diff --git a/Remontor/obj/Debug/Remontor.exe b/Remontor/obj/Debug/Remontor.exe index c0687ea..cc4cb20 100644 Binary files a/Remontor/obj/Debug/Remontor.exe and b/Remontor/obj/Debug/Remontor.exe differ diff --git a/Remontor/obj/Debug/Remontor.pdb b/Remontor/obj/Debug/Remontor.pdb index dacfc07..011c88b 100644 Binary files a/Remontor/obj/Debug/Remontor.pdb and b/Remontor/obj/Debug/Remontor.pdb differ diff --git a/Remontor/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/Remontor/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll index d6ee079..287f66e 100644 Binary files a/Remontor/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll and b/Remontor/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ