Добавили навигацию в поиск

This commit is contained in:
klavirshik 2024-10-23 19:10:42 +02:00
parent 74013f0e3f
commit ca9409a95e
30 changed files with 338 additions and 197 deletions

Binary file not shown.

View File

@ -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)

View File

@ -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)
{

View File

@ -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;
}
}

View File

@ -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<ISeacherResult> 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;
}
}

View File

@ -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)

View File

@ -250,6 +250,16 @@ namespace Remontor.Properties {
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ping_test {
get {
object obj = ResourceManager.GetObject("ping_test", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>

View File

@ -124,6 +124,9 @@
<data name="developer_mode_tv_24dp_48752C_FILL0_wght400_GRAD0_opsz24" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\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</value>
</data>
<data name="add_circle_24dp_19C016_FILL0_wght400_GRAD0_opsz24" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\add_circle_24dp_19C016_FILL0_wght400_GRAD0_opsz24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="2_size" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\2_size.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -208,7 +211,7 @@
<data name="reconnect" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\reconnect.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="add_circle_24dp_19C016_FILL0_wght400_GRAD0_opsz24" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\add_circle_24dp_19C016_FILL0_wght400_GRAD0_opsz24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="ping_test" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ping_test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -351,5 +351,8 @@
<ItemGroup>
<None Include="Resources\add_circle_24dp_19C016_FILL0_wght400_GRAD0_opsz24.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ping_test.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

View File

@ -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;
}
}
}

View File

@ -8,6 +8,8 @@ namespace Remontor.Seacher
{
internal interface ISeacherResult
{
string toString();
string toString();
IComp Result();
string ResultString();
}
}

View File

@ -17,7 +17,17 @@ namespace Remontor.Seacher
public string toString()
{
return "";
return Status;
}
public IComp Result()
{
return null;
}
public string ResultString()
{
return Status;
}
}
}

View File

@ -85,7 +85,7 @@ namespace Remontor.Seacher
++i;
enable = true;
if (i > 6) return result;
if (i > 20) return result;
}
}

View File

@ -28,60 +28,90 @@
/// </summary>
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;
}
}

View File

@ -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);
}
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.