public static void AddedToManager() { if (GetInstance() is IManagedHardware)//要保证<T>实现IManagedHardware { HardwareManager.AddHardWare(Name, GetInstance() as IManagedHardware); } else { throw new Exception(Name + "未实现IManagedHardware接口"); } }
public static void AddedToManager() { if (GetInstance() is IManagedHardware)//要保证<T>实现IManagedHardware { HardwareManager.AddHardWare(Name, GetInstance() as IManagedHardware); } else { throw new Exception(Name + "未实现IManagedHardware接口"); } }