| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 | 
							- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using WCS.Entity;
 
- namespace WCS.Core
 
- {
 
-     public abstract class EntityEx<T>
 
-     {
 
-         public T Entity
 
-         {
 
-             get;
 
-         }
 
-         protected EntityEx(T entity)
 
-         {
 
-             Entity = entity;
 
-         }
 
-         public virtual DateTime UpdateTime { get; set; }
 
-         public double Times => (DateTime.Now - UpdateTime).TotalMilliseconds;
 
-         public override string ToString()
 
-         {
 
-             return Entity.ToString();
 
-         }
 
-     }
 
-     public class Device<T> : EntityEx<WCS_DEVICE> where T : IProtocol
 
-     {
 
-         public T Data { get; }
 
-         public Device(WCS_DEVICE entity) : base(entity)
 
-         {
 
-             Data = entity.PROTOCOLS.Single(v => v.DB.PROTOCOL == typeof(T).AssemblyQualifiedName).Data<T>();
 
-         }
 
-     }
 
-     public class Device<T, T2> : Device<T> where T : IProtocol where T2 : IProtocol
 
-     {
 
-         public T2 Data2 { get; }
 
-         public Device(WCS_DEVICE entity) : base(entity)
 
-         {
 
-             Data2 = entity.PROTOCOLS.Single(v => v.DB.PROTOCOL == typeof(T2).AssemblyQualifiedName).Data<T2>();
 
-         }
 
-     }
 
-     public class Device<T, T2, T3> : Device<T, T2> where T : IProtocol where T2 : IProtocol where T3 : IProtocol
 
-     {
 
-         public T3 Data3 { get; }
 
-         public Device(WCS_DEVICE entity) : base(entity)
 
-         {
 
-             Data3 = entity.PROTOCOLS.Single(v => v.DB.PROTOCOL == typeof(T3).AssemblyQualifiedName).Data<T3>();
 
-         }
 
-     }
 
-     public class Device<T, T2, T3, T4> : Device<T, T2, T3> where T : IProtocol where T2 : IProtocol where T3 : IProtocol where T4 : IProtocol
 
-     {
 
-         public T4 Data4 { get; }
 
-         public Device(WCS_DEVICE entity) : base(entity)
 
-         {
 
-             Data4 = entity.PROTOCOLS.Single(v => v.DB.PROTOCOL == typeof(T4).AssemblyQualifiedName).Data<T4>();
 
-         }
 
-     }
 
-     public class Group<T> : EntityEx<WCS_DEVICE> where T : EntityEx<WCS_DEVICE>
 
-     {
 
-         public IEnumerable<T> Items { get; }
 
-         public Group(WCS_DEVICE entity) : base(entity)
 
-         {
 
-             Items = entity.DEVICEGROUP.Select(v => Activator.CreateInstance(typeof(T), v.MEMBER)).OfType<T>().OrderBy(p => p.Entity.CODE).ToList();
 
-         }
 
-     }
 
-     public class DeviceGroup<T> : Group<Device<T>> where T : IProtocol
 
-     {
 
-         public DeviceGroup(WCS_DEVICE entity) : base(entity)
 
-         {
 
-         }
 
-     }
 
-     public class DeviceGroup<T, T2> : Group<Device<T, T2>> where T : IProtocol where T2 : IProtocol
 
-     {
 
-         public DeviceGroup(WCS_DEVICE entity) : base(entity)
 
-         {
 
-         }
 
-     }
 
-     public class DeviceGroup<T, T2, T3> : Group<Device<T, T2, T3>> where T : IProtocol where T2 : IProtocol where T3 : IProtocol
 
-     {
 
-         public DeviceGroup(WCS_DEVICE entity) : base(entity)
 
-         {
 
-         }
 
-     }
 
- }
 
 
  |