добавляем результаты поиска

This commit is contained in:
klavirshik 2024-10-23 02:04:00 +02:00
parent c1d1a7c3d8
commit 74013f0e3f
29 changed files with 345 additions and 223 deletions

Binary file not shown.

View File

@ -29,19 +29,19 @@
private void InitializeComponent()
{
this.CompNameLB = new System.Windows.Forms.TextBox();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.SeaherPanel = new System.Windows.Forms.FlowLayoutPanel();
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.sessionItemControl6 = new Remontor.SessionItemControl();
this.sessionItemControl9 = new Remontor.SessionItemControl();
this.sessionItemControl8 = new Remontor.SessionItemControl();
this.sessionItemControl7 = new Remontor.SessionItemControl();
this.sessionItemControl5 = new Remontor.SessionItemControl();
this.flowLayoutPanel1.SuspendLayout();
this.SeaherPanel.SuspendLayout();
this.SuspendLayout();
//
// CompNameLB
@ -50,27 +50,23 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.CompNameLB.Location = new System.Drawing.Point(125, 12);
this.CompNameLB.Name = "CompNameLB";
this.CompNameLB.Size = new System.Drawing.Size(328, 20);
this.CompNameLB.Size = new System.Drawing.Size(602, 20);
this.CompNameLB.TabIndex = 0;
this.CompNameLB.TextChanged += new System.EventHandler(this.CompNameLB_TextChanged);
//
// flowLayoutPanel1
// SeaherPanel
//
this.flowLayoutPanel1.BackColor = System.Drawing.SystemColors.Window;
this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.flowLayoutPanel1.Controls.Add(this.sessionItemControl1);
this.flowLayoutPanel1.Controls.Add(this.sessionItemControl2);
this.flowLayoutPanel1.Controls.Add(this.sessionItemControl3);
this.flowLayoutPanel1.Controls.Add(this.sessionItemControl4);
this.flowLayoutPanel1.Controls.Add(this.sessionItemControl6);
this.flowLayoutPanel1.Controls.Add(this.sessionItemControl9);
this.flowLayoutPanel1.Controls.Add(this.sessionItemControl8);
this.flowLayoutPanel1.Controls.Add(this.sessionItemControl7);
this.flowLayoutPanel1.Controls.Add(this.sessionItemControl5);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 52);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(592, 398);
this.flowLayoutPanel1.TabIndex = 1;
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.Name = "SeaherPanel";
this.SeaherPanel.Size = new System.Drawing.Size(866, 385);
this.SeaherPanel.TabIndex = 1;
//
// label1
//
@ -84,7 +80,7 @@
// 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(459, 10);
this.ConnectBtn.Location = new System.Drawing.Point(733, 10);
this.ConnectBtn.Name = "ConnectBtn";
this.ConnectBtn.Size = new System.Drawing.Size(91, 23);
this.ConnectBtn.TabIndex = 3;
@ -92,81 +88,96 @@
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(264, 55);
this.sessionItemControl1.Size = new System.Drawing.Size(274, 55);
this.sessionItemControl1.TabIndex = 0;
//
// sessionItemControl2
//
this.sessionItemControl2.Location = new System.Drawing.Point(273, 3);
this.sessionItemControl2.Location = new System.Drawing.Point(283, 3);
this.sessionItemControl2.Name = "sessionItemControl2";
this.sessionItemControl2.Size = new System.Drawing.Size(264, 55);
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(264, 55);
this.sessionItemControl3.Size = new System.Drawing.Size(274, 55);
this.sessionItemControl3.TabIndex = 2;
//
// sessionItemControl4
//
this.sessionItemControl4.Location = new System.Drawing.Point(273, 64);
this.sessionItemControl4.Location = new System.Drawing.Point(563, 3);
this.sessionItemControl4.Name = "sessionItemControl4";
this.sessionItemControl4.Size = new System.Drawing.Size(264, 55);
this.sessionItemControl4.Size = new System.Drawing.Size(274, 55);
this.sessionItemControl4.TabIndex = 3;
//
// sessionItemControl6
//
this.sessionItemControl6.Location = new System.Drawing.Point(3, 125);
this.sessionItemControl6.Name = "sessionItemControl6";
this.sessionItemControl6.Size = new System.Drawing.Size(264, 55);
this.sessionItemControl6.TabIndex = 5;
//
// sessionItemControl9
//
this.sessionItemControl9.Location = new System.Drawing.Point(273, 125);
this.sessionItemControl9.Name = "sessionItemControl9";
this.sessionItemControl9.Size = new System.Drawing.Size(264, 55);
this.sessionItemControl9.TabIndex = 8;
//
// sessionItemControl8
//
this.sessionItemControl8.Location = new System.Drawing.Point(3, 186);
this.sessionItemControl8.Name = "sessionItemControl8";
this.sessionItemControl8.Size = new System.Drawing.Size(264, 55);
this.sessionItemControl8.TabIndex = 7;
//
// sessionItemControl7
//
this.sessionItemControl7.Location = new System.Drawing.Point(273, 186);
this.sessionItemControl7.Name = "sessionItemControl7";
this.sessionItemControl7.Size = new System.Drawing.Size(264, 55);
this.sessionItemControl7.TabIndex = 6;
//
// sessionItemControl5
//
this.sessionItemControl5.Location = new System.Drawing.Point(3, 247);
this.sessionItemControl5.Name = "sessionItemControl5";
this.sessionItemControl5.Size = new System.Drawing.Size(264, 55);
this.sessionItemControl5.TabIndex = 4;
//
// Finder
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(592, 450);
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.Controls.Add(this.ConnectBtn);
this.Controls.Add(this.label1);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.SeaherPanel);
this.Controls.Add(this.CompNameLB);
this.Name = "Finder";
this.Text = "Новое подключение";
this.flowLayoutPanel1.ResumeLayout(false);
this.SeaherPanel.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -175,17 +186,17 @@
#endregion
private System.Windows.Forms.TextBox CompNameLB;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
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 SessionItemControl sessionItemControl5;
private SessionItemControl sessionItemControl6;
private SessionItemControl sessionItemControl7;
private SessionItemControl sessionItemControl8;
private SessionItemControl sessionItemControl9;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button ConnectBtn;
}
}

View File

@ -1,4 +1,5 @@
using Remontor.Connector;
using Remontor.Seacher;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -11,8 +12,10 @@ using System.Windows.Forms;
namespace Remontor.Finder
{
public partial class Finder : Form
internal partial class Finder : Form
{
private bool StopRefreshSeacher = false;
private int PreSelected = -1;
public Finder()
{
InitializeComponent();
@ -23,5 +26,52 @@ namespace Remontor.Finder
SConnector.NewConnect(new CompId(CompNameLB.Text));
this.Close();
}
private void CompNameLB_TextChanged(object sender, EventArgs e)
{
if (sender is TextBox && !StopRefreshSeacher)
{
TextBox textBox = (TextBox)sender;
SSeaher.seaherMetod.Change(cb_comp_ResultUpdate, textBox.Text);
// CompSelected = null;
// ListComp.Visible = true;
}
}
public void cb_comp_ResultUpdate(List<ISeacherResult> Items)
{
PreSelected = -1;
int prewY = 0;
int CountY = 1;
SeaherPanel.Controls.Clear();
foreach (Control control in Items)
{
}
foreach (Control control in SeaherPanel.Controls)
{
if (control.Bounds.Y == prewY)
{
CountY++;
}
else if(prewY > 0)
{
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,11 +29,11 @@
private void InitializeComponent()
{
this.panel3 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.flowContainerWords1 = new Remontor.FlowContainerWords();
this.barSessionControl1 = new Remontor.BarSessionControl();
this.flowContainer1 = new Remontor.FlowContainer();
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();
//
@ -42,15 +42,50 @@
this.panel3.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.panel3.Controls.Add(this.flowConteinerSetting1);
this.panel3.Controls.Add(this.flowContainerWords1);
this.panel3.Controls.Add(this.flowContainer1);
this.panel3.Controls.Add(this.label1);
this.panel3.Location = new System.Drawing.Point(0, 25);
this.panel3.Location = new System.Drawing.Point(0, 12);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(1094, 693);
this.panel3.Size = new System.Drawing.Size(1094, 706);
this.panel3.TabIndex = 1;
//
// flowConteinerSetting1
//
this.flowConteinerSetting1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.flowConteinerSetting1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowConteinerSetting1.Location = new System.Drawing.Point(764, 40);
this.flowConteinerSetting1.Name = "flowConteinerSetting1";
this.flowConteinerSetting1.Size = new System.Drawing.Size(330, 678);
this.flowConteinerSetting1.TabIndex = 1;
this.flowConteinerSetting1.Visible = false;
//
// flowContainerWords1
//
this.flowContainerWords1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.flowContainerWords1.BackColor = System.Drawing.SystemColors.Control;
this.flowContainerWords1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.flowContainerWords1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowContainerWords1.Location = new System.Drawing.Point(764, 40);
this.flowContainerWords1.Margin = new System.Windows.Forms.Padding(0);
this.flowContainerWords1.Name = "flowContainerWords1";
this.flowContainerWords1.Size = new System.Drawing.Size(330, 678);
this.flowContainerWords1.TabIndex = 1;
this.flowContainerWords1.Visible = false;
//
// flowContainer1
//
this.flowContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.flowContainer1.BackColor = System.Drawing.Color.Transparent;
this.flowContainer1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.flowContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowContainer1.Location = new System.Drawing.Point(764, 40);
this.flowContainer1.Name = "flowContainer1";
this.flowContainer1.Size = new System.Drawing.Size(333, 678);
this.flowContainer1.TabIndex = 1;
this.flowContainer1.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
@ -61,20 +96,6 @@
this.label1.TabIndex = 0;
this.label1.Text = "Нету активныйх соединений";
//
// flowContainerWords1
//
this.flowContainerWords1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.flowContainerWords1.BackColor = System.Drawing.SystemColors.Control;
this.flowContainerWords1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.flowContainerWords1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowContainerWords1.Location = new System.Drawing.Point(764, 18);
this.flowContainerWords1.Margin = new System.Windows.Forms.Padding(0);
this.flowContainerWords1.Name = "flowContainerWords1";
this.flowContainerWords1.Size = new System.Drawing.Size(330, 678);
this.flowContainerWords1.TabIndex = 1;
this.flowContainerWords1.Visible = false;
//
// barSessionControl1
//
this.barSessionControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -85,36 +106,15 @@
this.barSessionControl1.TabIndex = 1;
this.barSessionControl1.Load += new System.EventHandler(this.barSessionControl1_Load);
//
// flowContainer1
//
this.flowContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.flowContainer1.BackColor = System.Drawing.Color.Transparent;
this.flowContainer1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.flowContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowContainer1.Location = new System.Drawing.Point(764, 18);
this.flowContainer1.Name = "flowContainer1";
this.flowContainer1.Size = new System.Drawing.Size(330, 675);
this.flowContainer1.TabIndex = 1;
this.flowContainer1.Visible = false;
//
// flowConteinerSetting1
//
this.flowConteinerSetting1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.flowConteinerSetting1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowConteinerSetting1.Location = new System.Drawing.Point(764, 18);
this.flowConteinerSetting1.Name = "flowConteinerSetting1";
this.flowConteinerSetting1.Size = new System.Drawing.Size(330, 675);
this.flowConteinerSetting1.TabIndex = 1;
this.flowConteinerSetting1.Visible = false;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1094, 718);
this.Controls.Add(this.barSessionControl1);
this.Controls.Add(this.flowContainer1);
this.Controls.Add(this.flowContainerWords1);
this.Controls.Add(this.flowConteinerSetting1);
this.Controls.Add(this.panel3);
this.Name = "Form1";
this.Text = "Form1";

View File

@ -21,24 +21,6 @@ namespace Remontor
public partial class Form1 : Form
{
private const int SWP_NOOWNERZORDER = 0x200;
private const int SWP_NOREDRAW = 0x8;
private const int SWP_NOZORDER = 0x4;
private const int SWP_SHOWWINDOW = 0x0040;
private const int WS_EX_MDICHILD = 0x40;
private const int SWP_FRAMECHANGED = 0x20;
private const int SWP_NOACTIVATE = 0x10;
private const int SWP_ASYNCWINDOWPOS = 0x4000;
private const int SWP_NOMOVE = 0x2;
private const int SWP_NOSIZE = 0x1;
private const int GWL_STYLE = (-16);
private const int WS_VISIBLE = 0x10000000;
private const int WM_CLOSE = 0x10;
private const int WS_CHILD = 0x40000000;
Process p1;
Process p;
public bool CloseOn = false;
public Form1()
@ -60,32 +42,7 @@ namespace Remontor
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
//p1 = Process.Start("notepad");
////Thread.Sleep(500); // Allow the process to open it's window
//p1.WaitForInputIdle();
//SetParent(p1.MainWindowHandle, panel1.Handle);
//SetWindowLong(p1.MainWindowHandle, GWL_STYLE, WS_VISIBLE);
//MoveWindow(p1.MainWindowHandle, panel1.Bounds.X, panel1.Bounds.Y - 24, panel1.Bounds.Width, panel1.Bounds.Height, true);
//p = Process.Start("notepad");
//Thread.Sleep(500); // Allow the process to open it's window
//p.WaitForInputIdle();
//SetParent(p.MainWindowHandle, panel3.Handle);
//SetWindowLong(p.MainWindowHandle, GWL_STYLE, WS_VISIBLE);
//MoveWindow(p.MainWindowHandle, panel3.Bounds.X, panel3.Bounds.Y, panel3.Bounds.Width, panel3.Bounds.Height, true);
}
private void FlowConteinerSetting1_Save()
@ -103,8 +60,7 @@ namespace Remontor
private void tabControl1_SizeChanged(object sender, EventArgs e)
{
SConnector.ResizeActiv();
//MoveWindow(p1.MainWindowHandle, panel1.Bounds.X, panel1.Bounds.Y - 24, panel1.Bounds.Width, panel1.Bounds.Height, true);
//MoveWindow(p.MainWindowHandle, panel3.Bounds.X, panel3.Bounds.Y, panel3.Bounds.Width, panel3.Bounds.Height, true);
}
protected override void WndProc(ref Message m)

View File

@ -112,7 +112,10 @@
<Compile Include="SCCMsearch\AuthLogin.cs" />
<Compile Include="SCCMsearch\AuthWin.cs" />
<Compile Include="SCCMsearch\IAuthType.cs" />
<Compile Include="Seacher\ISeacherResult.cs" />
<Compile Include="Seacher\ISeaherMetod.cs" />
<Compile Include="Seacher\HistoryResult.cs" />
<Compile Include="Seacher\NoResult.cs" />
<Compile Include="Seacher\SeachSCCM.cs" />
<Compile Include="Seacher\SeahcLocal.cs" />
<Compile Include="Seacher\SSeaher.cs" />

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Remontor.Seacher
{
internal class HistoryResult : ISeacherResult
{
private IComp Comp;
private DateTime LastConnect;
public HistoryResult()
{
}
public HistoryResult(IComp comp, DateTime lastConnect)
{
Comp = comp;
LastConnect = lastConnect;
}
public string toString()
{
return Comp.GetNetNameStr();
}
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Remontor.Seacher
{
internal interface ISeacherResult
{
string toString();
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Remontor.Seacher
{
internal class NoResult : ISeacherResult
{
private string Status;
public NoResult(string status)
{
Status = status;
}
public string toString()
{
return "";
}
}
}

View File

@ -60,31 +60,31 @@ namespace Remontor.Seacher
}
public void Change(ResultUpdate sender, string seach)
{
Activate();
Update = sender;
if (Connection != null && Connection.State == ConnectionState.Open)
{
List<string> result;
if (seach.Length > 2)
{
result = ResultSeach(seach);
int itemHeight = 14;
if(enable) itemHeight = 40;
Update(result, enable, itemHeight);
}
else
{
result = new List<string>();
result.Add("Введите запрос, к бд подключенно");
Update(result, false, 14);
}
}
else
{
List<string> result = new List<string>();
result.Add(error);
Update(result, false,14);
}
//Activate();
//Update = sender;
//if (Connection != null && Connection.State == ConnectionState.Open)
//{
// List<string> result;
// if (seach.Length > 2)
// {
// result = ResultSeach(seach);
// int itemHeight = 14;
// if(enable) itemHeight = 40;
// Update(result, enable, itemHeight);
// }
// else
// {
// result = new List<string>();
// result.Add("Введите запрос, к бд подключенно");
// Update(result, false, 14);
// }
//}
//else
//{
// List<string> result = new List<string>();
// result.Add(error);
// Update(result, false,14);
//}
}
@ -194,9 +194,9 @@ namespace Remontor.Seacher
Connection.Close();
Connection = null;
TimerDisconnect.Dispose();
List<string> result = new List<string>();
result.Add("Введите запрос");
Update(result, false, 14);
List<ISeacherResult> result = new List<ISeacherResult>();
result.Add(new NoResult("Введите запрос"));
Update(result);
}
public IComp Result(int index)

View File

@ -9,7 +9,7 @@ namespace Remontor.Seacher
{
internal class SeahcLocal : ISeaherMetod
{
internal delegate void ResultUpdate(List<string> Item, bool eneble, int itemHeight);
internal delegate void ResultUpdate(List<ISeacherResult> Item);
private ResultUpdate Update;
private List<IComp> comps = new List<IComp>();
private bool enable;
@ -19,49 +19,86 @@ namespace Remontor.Seacher
if (seach.Length > 2)
{
Update(ResultSeach(seach), enable,14);
Update(ResultSeach(seach));
}
else
{
List<string> result = new List<string>();
result.Add("Введите запрос");
Update(result,false, 14);
List<ISeacherResult> result = new List<ISeacherResult>();
result.Add(new NoResult("Введите запрос"));
Update(result);
}
}
public List<string> ResultSeach(string seach)
//public List<string> ResultSeach(string seach)
//{
// int i = 0;
// comps.Clear();
// List<string> result = new List<string>();
// foreach(HistoryItem item in HistoryList.Hitem)
// {
// if (item.NameNode().ToUpper().Contains(seach.ToUpper()))
// {
// int y = 0;
// foreach(string itemOk in result)
// {
// if (itemOk.ToUpper() == item.NameNode().ToUpper()) ++y;
// }
// if(y == 0)
// {
// result.Add(item.NameNode());
// comps.Add(item.GetComp());
// ++i;
// enable = true;
// if (i>6) return result;
// }
// }
// }
// if (i == 0)
// {
// enable = false;
// result.Add("Ничего не найдено");
// }
// return result;
//}
public List<ISeacherResult> ResultSeach(string seach)
{
int i = 0;
comps.Clear();
List<string> result = new List<string>();
foreach(HistoryItem item in HistoryList.Hitem)
List<ISeacherResult> result = new List<ISeacherResult>();
foreach (HistoryItem item in HistoryList.Hitem)
{
if (item.NameNode().ToUpper().Contains(seach.ToUpper()))
{
int y = 0;
foreach(string itemOk in result)
foreach (ISeacherResult itemOk in result)
{
if (itemOk.ToUpper() == item.NameNode().ToUpper()) ++y;
if (itemOk.toString().ToUpper() == item.NameNode().ToUpper()) ++y;
}
if(y == 0)
if (y == 0)
{
result.Add(item.NameNode());
comps.Add(item.GetComp());
HistoryResult itemResult = new HistoryResult(item.GetComp(), item.GetStart());
result.Add(itemResult);
++i;
enable = true;
if (i>6) return result;
if (i > 6) return result;
}
}
}
if (i == 0)
{
{
enable = false;
result.Add("Ничего не найдено");
result.Add(new NoResult("Ничего не найдено"));
}
return result;
}
public IComp Result(int index)
{
return comps[index];

View File

@ -49,9 +49,9 @@
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(57, 33);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(38, 13);
this.label2.Size = new System.Drawing.Size(57, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Логин";
this.label2.Text = "LastLogon";
//
// label3
//
@ -80,7 +80,7 @@
this.Controls.Add(this.label1);
this.Controls.Add(this.pictureBox1);
this.Name = "SessionItemControl";
this.Size = new System.Drawing.Size(264, 55);
this.Size = new System.Drawing.Size(274, 55);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
b0e7fcb2ee6e153bc54901d6d96fe11158f2ea6b
15aad57089c73c036769b7df150a74520e07d0a0

View File

@ -33,7 +33,6 @@ C:\Users\klavi\Source\Repos\Remontor\Remontor\obj\Debug\Remontor.FlowContainer.r
C:\Users\klavi\Source\Repos\Remontor\Remontor\obj\Debug\Remontor.Form1.resources
C:\Users\klavi\Source\Repos\Remontor\Remontor\obj\Debug\Remontor.Properties.Resources.resources
C:\Users\klavi\Source\Repos\Remontor\Remontor\obj\Debug\Remontor.SessionItemControl.resources
C:\Users\klavi\Source\Repos\Remontor\Remontor\obj\Debug\Remontor.Setting.SettingRebootControl.resources
C:\Users\klavi\Source\Repos\Remontor\Remontor\obj\Debug\Remontor.Setting.SettingSCCMControl.resources
C:\Users\klavi\Source\Repos\Remontor\Remontor\obj\Debug\Remontor.Setting.SettingWordsControl.resources
C:\Users\klavi\Source\Repos\Remontor\Remontor\obj\Debug\Remontor.Words.BilderWords.resources
@ -51,3 +50,5 @@ C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Flow
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.History.HistoryControl.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.FlowConteinerSetting.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Setting.settingAppControl.resources
C:\Users\klavi\source\repos\Remontor\Remontor\obj\Debug\Remontor.FlowConteinerSetting.resources
C:\Users\klavi\source\repos\Remontor\Remontor\obj\Debug\Remontor.Setting.settingAppControl.resources

Binary file not shown.

Binary file not shown.