Device.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
  public override string ToString ()
  {		
		return string.Format ("[Device: id : {0}, name: {1}, [ExpressionModules: {2}]", _id, displayedName, Logger.ToString(_modules));
  }

Usage Example

示例#1
0
        private void SetPanelImage(Device device, PingReply reply)
        {
            BeginInvoke((MethodInvoker) delegate
            {
                WriteLine("Setting panel image for " + device.ToString() + " " + reply.Status.ToString());
                Panel selectedPanel = (
                    from Control unk in Controls
                    where
                    (unk is Panel) &&
                    (unk.Name == device.ToString())     // ... or however you go about finding the panel...
                    select unk as Panel
                    ).FirstOrDefault();

                if (selectedPanel != null)
                {
                    switch (reply.Status)
                    {
                    case IPStatus.Success:
                        // Set image for enabled
                        break;

                    case IPStatus.TimedOut:
                        // Set image as disabled
                        break;

                    default:
                        // Set image as disabled
                        break;
                    }
                }
            });
        }
All Usage Examples Of Device::ToString