コード例 #1
0
 /// <summary>
 /// Initializes object instance
 /// </summary>
 /// <param name="logClient">log client object</param>
 public LogClient(CNetLogClient logClient)
 {
     if (logClient == null)
     {
         throw new ArgumentNullException("logClient");
     }
     _logClient = logClient;
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: uvbs/SupportCenter
 /// <summary>
 /// Client found event handler from GUI thread
 /// </summary>
 /// <param name="client"></param>
 void logViewer_OnClientFoundSync(CNetLogClient client)
 {
     try
     {
         clientsListBox.Items.Add(new LogClient(client));
     }
     catch (System.Exception exception)
     {
         System.Windows.Forms.MessageBox.Show(exception.ToString(), "Error gettint clients", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: uvbs/SupportCenter
 /// <summary>
 ///  Client found event handler
 /// </summary>
 /// <param name="client">found client</param>
 void _logViewer_OnClientFound(CNetLogClient client)
 {
     try
     {
         if (client == null)
         {
             throw new ArgumentNullException("client");
         }
         clientsListBox.Invoke(new DelegateClientFound(this.logViewer_OnClientFoundSync), new object[] { client });
     }
     catch (System.Exception exception)
     {
         System.Windows.Forms.MessageBox.Show(exception.ToString(), "Error gettint clients", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: uvbs/SupportCenter
 /// <summary>
 /// Client timed out event handler
 /// </summary>
 /// <param name="client">timed out client</param>
 void _logViewer_OnClientTimedOut(CNetLogClient client)
 {
     try
     {
         if (client == null)
         {
             throw new ArgumentNullException("client");
         }
         clientsListBox.Items.Remove(new LogClient(client));
     }
     catch (System.Exception exception)
     {
         System.Windows.Forms.MessageBox.Show(exception.ToString(), "Error gettint clients", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: uvbs/SupportCenter
 /// <summary>
 /// refresh client list event handler
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void refreshBtn_Click(object sender, EventArgs e)
 {
     try
     {
         clientsListBox.Items.Clear();
         System.Collections.IEnumerable clientList = _logViewer.GetClientsList();
         if (clientList == null)
         {
             throw new System.Exception("GetClientsList returned null enumerable");
         }
         foreach (Object obj in clientList)
         {
             CNetLogClient logClient = obj as CNetLogClient;
             if (logClient != null)
             {
                 clientsListBox.Items.Add(new LogClient(logClient));
             }
         }
     }
     catch (System.Exception exception)
     {
         System.Windows.Forms.MessageBox.Show(exception.ToString(), "Error gettint clients", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #6
0
ファイル: LogClient.cs プロジェクト: uvbs/SupportCenter
 /// <summary>
 /// Initializes object instance
 /// </summary>
 /// <param name="logClient">log client object</param>
 public LogClient(CNetLogClient logClient)
 {
     if (logClient == null)
         throw new ArgumentNullException("logClient");
     _logClient = logClient;
 }
コード例 #7
0
ファイル: Form1.cs プロジェクト: uvbs/SupportCenter
 /// <summary>
 /// Client found event handler from GUI thread
 /// </summary>
 /// <param name="client"></param>
 void logViewer_OnClientFoundSync(CNetLogClient client)
 {
     try
     {
         clientsListBox.Items.Add(new LogClient(client));
     }
     catch (System.Exception exception)
     {
         System.Windows.Forms.MessageBox.Show(exception.ToString(), "Error gettint clients", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #8
0
ファイル: Form1.cs プロジェクト: uvbs/SupportCenter
 /// <summary>
 /// Client timed out event handler
 /// </summary>
 /// <param name="client">timed out client</param>
 void _logViewer_OnClientTimedOut(CNetLogClient client)
 {
     try
     {
         if (client == null)
             throw new ArgumentNullException("client");
         clientsListBox.Items.Remove(new LogClient(client));
     }
     catch (System.Exception exception)
     {
         System.Windows.Forms.MessageBox.Show(exception.ToString(), "Error gettint clients", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #9
0
ファイル: Form1.cs プロジェクト: uvbs/SupportCenter
 /// <summary>
 ///  Client found event handler
 /// </summary>
 /// <param name="client">found client</param>
 void _logViewer_OnClientFound(CNetLogClient client)
 {
     try
     {
         if (client == null)
             throw new ArgumentNullException("client");
         clientsListBox.Invoke(new DelegateClientFound(this.logViewer_OnClientFoundSync), new object[] { client });
     }
     catch (System.Exception exception)
     {
         System.Windows.Forms.MessageBox.Show(exception.ToString(), "Error gettint clients", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }