示例#1
0
 /// <summary>
 /// 添加设备
 /// </summary>
 /// <param name="device"></param>
 public static bool AddDevice(ComDevice device)
 {
     lock (obj)
     {
         if (DeviceList.ContainsKey(device.Name))
         {
             MsgLogger.PushMsg(device.Name, "Add", "Already exist.");
             return(false);
         }
         else
         {
             DeviceList.Add(device.Name, device);
             MsgLogger.PushMsg(device.Name, "Add", "Success.");
             return(true);
         }
     }
 }