класс соединений добавил

This commit is contained in:
klavirshik 2024-10-10 18:58:21 +02:00
parent 79ca250ce8
commit 35c865e203
41 changed files with 295 additions and 27 deletions

Binary file not shown.

View File

@ -5,7 +5,7 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace Reseter2
namespace Remontor
{
[Serializable]
internal class CompId : IComp

View File

@ -5,7 +5,7 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace Reseter2
namespace Remontor
{
internal interface IComp
{

View File

@ -7,6 +7,16 @@ using System.Threading.Tasks;
namespace Remontor.Connector
{
internal class Connect
{
{
public IComp Comp;
public Connect(IComp comp)
{
Comp = comp;
}
}
}

View File

@ -6,7 +6,12 @@ using System.Threading.Tasks;
namespace Remontor.Connector
{
internal class SConnector
internal static class SConnector
{
private static List<Connect> Connects = new List<Connect>();
public static void NewConnect(IComp comp)
{
Connects.Add(new Connect(comp));
}
}
}

View File

@ -29,9 +29,9 @@
private void InitializeComponent()
{
this.panel3 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.barSessionControl1 = new Remontor.BarSessionControl();
this.flowContainer1 = new Remontor.FlowContainer();
this.label1 = new System.Windows.Forms.Label();
this.panel3.SuspendLayout();
this.SuspendLayout();
//
@ -47,6 +47,15 @@
this.panel3.TabIndex = 1;
this.panel3.Paint += new System.Windows.Forms.PaintEventHandler(this.panel3_Paint);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(467, 361);
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.Right)));
@ -54,6 +63,7 @@
this.barSessionControl1.Name = "barSessionControl1";
this.barSessionControl1.Size = new System.Drawing.Size(694, 21);
this.barSessionControl1.TabIndex = 1;
this.barSessionControl1.Load += new System.EventHandler(this.barSessionControl1_Load);
//
// flowContainer1
//
@ -67,15 +77,6 @@
this.flowContainer1.Size = new System.Drawing.Size(245, 674);
this.flowContainer1.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(467, 361);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(151, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Нету активныйх соединений";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -97,6 +97,11 @@ namespace Remontor
{
}
private void barSessionControl1_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,69 @@
using Remontor.Connector;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace Remontor.History
{
[Serializable]
internal class HistoryItem
{
private IComp comp;
private DateTime startTime;
private string statusName;
public HistoryItem(IComp comp, DateTime startTime)
{
this.comp = comp;
this.startTime = startTime;
}
public HistoryItem(Connect connect)
{
this.comp = connect.Comp;
this.startTime = DateTime.Now;
}
public SHistory GetData()
{
return new SHistory(comp.GetName(), startTime.ToShortTimeString());
}
public IComp GetComp()
{
return comp;
}
public string NameNode()
{
string buf;
if (comp.GetName() == null)
{
buf = comp.GetNetNameStr();
}
else
{
buf = comp.GetName();
if (comp.GetNetNameStr() != null) buf += "(" + comp.GetNetNameStr() + ")";
}
return buf;
}
public string ToStr
{
get {
string name = NameNode();
name = name.Length > 25 ? name.Substring(0,25): name;
string output = string.Format("{0,17:dd.MM.yy HH:mm:ss} {1,-25} {2,-9}", startTime, name, this.statusName);
return output;
}
}
}
}

View File

@ -0,0 +1,54 @@
using Remontor.Connector;
using Remontor.Setting;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Remontor.History
{
[Serializable]
internal static class HistoryList
{
static public List<HistoryItem> Hitem = new List<HistoryItem>();
//static private FormHistory formHistory;
public delegate void UpdateMethod();
static public event UpdateMethod Update;
static public HistoryItem Add(Connect connect)
{
HistoryItem historyItem = new HistoryItem(connect);
Hitem.Insert(0, historyItem);
ClearFirst();
Update();
return historyItem;
}
static public void Updated()
{
Update();
}
static public void Clear()
{
Hitem.Clear();
}
static public void ClearFirst()
{
if(Hitem.Count > SGlobalSetting.settingReboot.sizeHistoryItem)
{
Hitem.RemoveAt(Hitem.Count() - 1);
ClearFirst();
}
}
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Remontor.History
{
internal struct SHistory
{
public string Name;
public string StartTime;
public SHistory(string name, string startTime)
{
Name = name;
StartTime = startTime;
}
}
}

View File

@ -52,6 +52,10 @@
<Compile Include="BarSessionControl.Designer.cs">
<DependentUpon>BarSessionControl.cs</DependentUpon>
</Compile>
<Compile Include="Comp\CompName.cs" />
<Compile Include="Comp\IComp.cs" />
<Compile Include="Connector\Connect.cs" />
<Compile Include="Connector\SConnector.cs" />
<Compile Include="Finder\Finder.cs">
<SubType>Form</SubType>
</Compile>
@ -70,14 +74,83 @@
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="History\HistoryItem.cs" />
<Compile Include="History\HistoryList.cs" />
<Compile Include="History\SHistory.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SCCMsearch\AuthLogin.cs" />
<Compile Include="SCCMsearch\AuthWin.cs" />
<Compile Include="SCCMsearch\IAuthType.cs" />
<Compile Include="Seacher\ISeaherMetod.cs" />
<Compile Include="Seacher\SeachSCCM.cs" />
<Compile Include="Seacher\SeahcLocal.cs" />
<Compile Include="Seacher\SSeaher.cs" />
<Compile Include="SessionItemControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SessionItemControl.Designer.cs">
<DependentUpon>SessionItemControl.cs</DependentUpon>
</Compile>
<Compile Include="Setting\SettingExpand.cs" />
<Compile Include="Setting\SettingReboot.cs" />
<Compile Include="Setting\SettingRebootControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Setting\SettingRebootControl.Designer.cs">
<DependentUpon>SettingRebootControl.cs</DependentUpon>
</Compile>
<Compile Include="Setting\SettingSCCM.cs" />
<Compile Include="Setting\SettingSCCMControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Setting\SettingSCCMControl.Designer.cs">
<DependentUpon>SettingSCCMControl.cs</DependentUpon>
</Compile>
<Compile Include="Setting\SettingWords.cs" />
<Compile Include="Setting\SettingWordsControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Setting\SettingWordsControl.Designer.cs">
<DependentUpon>SettingWordsControl.cs</DependentUpon>
</Compile>
<Compile Include="Setting\SGlobalSetting.cs" />
<Compile Include="Setting\SSetting.cs" />
<Compile Include="Words\BilderWords.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Words\BilderWords.Designer.cs">
<DependentUpon>BilderWords.cs</DependentUpon>
</Compile>
<Compile Include="Words\IWordsContol.cs" />
<Compile Include="Words\IWordsItem.cs" />
<Compile Include="Words\WordsCategory.cs" />
<Compile Include="Words\WordsCategoryControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Words\WordsCategoryControl.Designer.cs">
<DependentUpon>WordsCategoryControl.cs</DependentUpon>
</Compile>
<Compile Include="Words\WordsComp.cs" />
<Compile Include="Words\WordsEditCategoryControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Words\WordsEditCategoryControl.Designer.cs">
<DependentUpon>WordsEditCategoryControl.cs</DependentUpon>
</Compile>
<Compile Include="Words\WordsEditCompControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Words\WordsEditCompControl.Designer.cs">
<DependentUpon>WordsEditCompControl.cs</DependentUpon>
</Compile>
<Compile Include="Words\WordsItemControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Words\WordsItemControl.Designer.cs">
<DependentUpon>WordsItemControl.cs</DependentUpon>
</Compile>
<Compile Include="Words\WordsList.cs" />
<EmbeddedResource Include="BarSessionControl.resx">
<DependentUpon>BarSessionControl.cs</DependentUpon>
</EmbeddedResource>
@ -103,6 +176,30 @@
<EmbeddedResource Include="SessionItemControl.resx">
<DependentUpon>SessionItemControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Setting\SettingRebootControl.resx">
<DependentUpon>SettingRebootControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Setting\SettingSCCMControl.resx">
<DependentUpon>SettingSCCMControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Setting\SettingWordsControl.resx">
<DependentUpon>SettingWordsControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Words\BilderWords.resx">
<DependentUpon>BilderWords.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Words\WordsCategoryControl.resx">
<DependentUpon>WordsCategoryControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Words\WordsEditCategoryControl.resx">
<DependentUpon>WordsEditCategoryControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Words\WordsEditCompControl.resx">
<DependentUpon>WordsEditCompControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Words\WordsItemControl.resx">
<DependentUpon>WordsItemControl.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

View File

@ -8,8 +8,8 @@ namespace Remontor.SCCMsearch
{
internal interface IAuthType
{
public string Name { get; }
public string Password { get; }
public string AuthString();
string Name { get; }
string Password { get; }
string AuthString();
}
}

View File

@ -9,9 +9,9 @@ namespace Remontor.Seacher
{
internal interface ISeaherMetod
{
public void Change(ResultUpdate sender, string seach);
public IComp Result(int index);
public string ResultString(int index);
void Change(ResultUpdate sender, string seach);
IComp Result(int index);
string ResultString(int index);
}
}

View File

@ -91,8 +91,8 @@ namespace Remontor.Seacher
private string QueryBilder(string query)
{
string result;
Regex regexCyrillic = new(@"\p{IsCyrillic}+", RegexOptions.IgnoreCase);
Regex regexNumrable = new(@"\d+", RegexOptions.IgnoreCase);
Regex regexCyrillic = new Regex(@"\p{IsCyrillic}+", RegexOptions.IgnoreCase);
Regex regexNumrable = new Regex(@"\d+", RegexOptions.IgnoreCase);
MatchCollection jjj = regexNumrable.Matches(query);
if (regexCyrillic.Matches(query).Count > 0)
{

View File

@ -82,7 +82,7 @@ namespace Remontor.Setting
private void bt_checkConnect_Click(object sender, EventArgs e)
{
SeachSCCM SeacherCheck = new(cb_windowsAuth.Checked, ib_username.Text, ib_password.Text);
SeachSCCM SeacherCheck = new SeachSCCM(cb_windowsAuth.Checked, ib_username.Text, ib_password.Text);
MessageBox.Show(SeacherCheck.CheckConnect(ib_server.Text,ib_dataBase.Text));
}
}

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Reseter2.Words
namespace Remontor.Words
{
internal interface IWordsContol
{

View File

@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Reseter2.Words
namespace Remontor.Words
{
[Serializable]
internal abstract class IWordsItem

View File

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Reseter2.Words
namespace Remontor.Words
{
[Serializable]
internal class WordsCategory : IWordsItem

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
5dbc82744c739a57c33771a80f9ca9244fbf42fb
a242571a09c5a9eb69787b6862e9dfdf49e5e5fd

View File

@ -13,3 +13,11 @@ C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Flow
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.SessionItemControl.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.BarSessionControl.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Finder.Finder.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Setting.SettingRebootControl.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Setting.SettingSCCMControl.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Setting.SettingWordsControl.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Words.BilderWords.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Words.WordsCategoryControl.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Words.WordsEditCategoryControl.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Words.WordsEditCompControl.resources
C:\Users\Владимир\source\repos\Remontor\Remontor\obj\Debug\Remontor.Words.WordsItemControl.resources

Binary file not shown.

Binary file not shown.