Exemple #1
0
 public TelecomDeviceRegistration(TelecomDeviceRegistrationData dbRecord) :
     base(dbRecord)
 {
     Data.Address = Data.Address ?? new GeographicAddressData();
     Data.Device  = Data.Device ?? new TelecomAddressData();
     Address      = AddressFactory.Create(Data.Address) as GeographicAddress;
     Device       = AddressFactory.Create(Data.Device) as TelecomAddress;
 }
        public static TelecomDeviceRegistration Create(GeographicAddress address,
                                                       TelecomAddress device,
                                                       DateTime?validFrom = null, DateTime?validTo = null)
        {
            var o = new TelecomDeviceRegistrationData {
                Address   = address?.Data ?? new GeographicAddressData(),
                Device    = device?.Data ?? new TelecomAddressData(),
                ValidFrom = validFrom ?? DateTime.MinValue,
                ValidTo   = validTo ?? DateTime.MaxValue
            };

            o.AddressID = o.Address?.ID;
            o.DeviceID  = o.Device?.ID;
            return(new TelecomDeviceRegistration(o));
        }
Exemple #3
0
 public void RegisteredTelecomDevice(TelecomAddress adr)
 {
     if (adr is null)
     {
         return;
     }
     if (adr.Data.ID == Constants.Unspecified)
     {
         return;
     }
     if (registeredDevices.Find(
             x => x.Data.ID == adr.Data.ID) != null)
     {
         return;
     }
     registeredDevices.Add(adr);
 }