コード例 #1
0
        private void DataReceived(SocketData Data, SocketsServerClient sender)
        {
            try
            {
                this._dataCount++;
                this.SetTextBoxText(this.txtDataReceivedCount, System.Convert.ToString(this._dataCount));

                if (this.chkshowIncommingData.Checked)
                {
                    this.SetListBoxItem(this.lstServerData, Data);
                    string logStr = DateTime.Now.ToString() + "-> " + Data.XMLDataString;
                    this.SetListBoxItem(this.lstReceptionLog, logStr);
                    //displays the attributes list
                    ListBox_Items_Clear(this.lstDataAttributes);
                    UtilitiesLibrary.Parametrization.Attribute attr = default(UtilitiesLibrary.Parametrization.Attribute);
                    IEnumerator enumm      = Data.AttributesTable.GetEnumerator();
                    string      attrString = "";
                    while (enumm.MoveNext())
                    {
                        attr       = (UtilitiesLibrary.Parametrization.Attribute)enumm.Current;
                        attrString = attr.Name + "   -   " + attr.Value;
                        ListBox_Items_Add(this.lstDataAttributes, attrString);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
 public void lstBoxDataReceived_SelectedIndexChanged(System.Object sender, System.EventArgs e)
 {
     try
     {
         this.lstDataAttributes.Items.Clear();
         SocketData data = (SocketData)this.lstBoxDataReceived.SelectedItem;
         if (!(data == null))
         {
             if (data.AttributesTable.Count > 0)
             {
                 UtilitiesLibrary.Parametrization.Attribute attr = null;
                 string      attrStr   = "";
                 IEnumerator attrEnumm = data.AttributesTable.GetEnumerator();
                 while (attrEnumm.MoveNext())
                 {
                     attr    = (UtilitiesLibrary.Parametrization.Attribute)attrEnumm.Current;
                     attrStr = attr.Name + "   -   " + attr.Value;
                     this.lstDataAttributes.Items.Add(attrStr);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }