Esempio n. 1
0
        public static DevicePayload FromDevice(Device device)
        {
            var item = new DevicePayload();

            ThingPayload.CopyFromThing(item, device);
            LogicableItemUtils.CopyFromLogicable(item, device);
            return(item);
        }
Esempio n. 2
0
 public static ThingPayload FromThingByType(Thing thing)
 {
     if (thing is Device)
     {
         return(DevicePayload.FromDevice((Device)thing));
     }
     if (thing is Item)
     {
         return(ItemPayload.FromItem((Item)thing));
     }
     return(ThingPayload.FromThing(thing));
 }