Ejemplo n.º 1
0
        internal static PreservationInStorageDevice Convert(this BibDSModel.PreservationInStorageDevice sto, int level = 0, int deeplevel = 5, params Type[] ignoredTypes)
        {
            if (sto == null || level > deeplevel)
            {
                return(null);
            }

            var ret = new PreservationInStorageDevice
            {
                //Device = sto.PreservationStorageDevice.Convert(level + 1, deeplevel),
                Path = sto.Path,
                //Preservation = sto.Preservation.Convert(level + 1, deeplevel),
            };

            var tipiIgnorati = ignoredTypes ?? new Type[0];

            if (!tipiIgnorati.Contains(typeof(PreservationStorageDevice)))
            {
                ret.Device = sto.PreservationStorageDevice.Convert(level + 1, deeplevel, ignoredTypes);
            }

            if (!tipiIgnorati.Contains(typeof(Preservation)))
            {
                ret.Preservation = sto.Preservation.Convert(level + 1, deeplevel, ignoredTypes);
            }

            return(ret);
        }
 public void DeletePreservationInStorageDevice(PreservationInStorageDevice preservationInStorageDevice)
 {
     try
     {
         var svc = new PreservationService();
         svc.DeletePreservationInStorageDevice(preservationInStorageDevice);
     }
     catch (Exception ex)
     {
         throw CheckExceptionToThrow(ex);
     }
 }
 public PreservationInStorageDevice AddPreservationInStorageDevice(PreservationInStorageDevice toAdd)
 {
     try
     {
         var svc = new PreservationService();
         return(svc.AddPreservationInStorageDevice(toAdd));
     }
     catch (Exception ex)
     {
         throw CheckExceptionToThrow(ex);
     }
 }