78 lines
2.0 KiB
C#
78 lines
2.0 KiB
C#
using Remontor.Connector;
|
|
using Remontor.Seacher;
|
|
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 Remontor.Finder
|
|
{
|
|
internal partial class Finder : Form
|
|
{
|
|
private bool StopRefreshSeacher = false;
|
|
private int PreSelected = -1;
|
|
public Finder()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void ConnectBtn_Click(object sender, EventArgs e)
|
|
{
|
|
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;
|
|
|
|
|
|
}
|
|
}
|
|
}
|