Ejemplo n.º 1
0
 public override void FromManagementObject(ManagementObject m)
 {
     base.FromManagementObject(m);
     this.FriendlyName                  = SpacesApiUtil.GetManagementObjectValue <string>(m, "FriendlyName");
     this.Name                          = SpacesApiUtil.GetManagementObjectValue <string>(m, "Name");
     this.NameFormat                    = (NameFormatEnum)Enum.ToObject(typeof(NameFormatEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "NameFormat"));
     this.UniqueIdFormat                = (UniqueIdFormatEnum)Enum.ToObject(typeof(UniqueIdFormatEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "UniqueIdFormat"));
     this.Usage                         = (VirtualDiskUsage)Enum.ToObject(typeof(VirtualDiskUsage), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "Usage"));
     this.OperationalStatus             = SpacesApiUtil.ManagementObjectArrayToList <OperationalStatusEnum, ushort>(m["OperationalStatus"]);
     this.HealthStatus                  = (HealthStatusEnum)Enum.ToObject(typeof(HealthStatusEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "HealthStatus"));
     this.ResiliencySettingName         = SpacesApiUtil.GetManagementObjectValue <string>(m, "ResiliencySettingName");
     this.Size                          = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "Size");
     this.AllocatedSize                 = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "AllocatedSize");
     this.PhysicalSectorSize            = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "PhysicalSectorSize");
     this.LogicalSectorSize             = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "LogicalSectorSize");
     this.FootprintOnPool               = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "FootprintOnPool");
     this.ProvisioningType              = (ProvisioningTypeEnum)Enum.ToObject(typeof(ProvisioningTypeEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "ProvisioningType"));
     this.NumberOfDataCopies            = SpacesApiUtil.GetManagementObjectValue <ushort>(m, "NumberOfDataCopies");
     this.PhysicalDiskRedundancy        = SpacesApiUtil.GetManagementObjectValue <ushort>(m, "PhysicalDiskRedundancy");
     this.ParityLayout                  = (ParityLayoutEnum)Enum.ToObject(typeof(ParityLayoutEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "ParityLayout"));
     this.NumberOfColumns               = SpacesApiUtil.GetManagementObjectValue <ushort>(m, "NumberOfColumns");
     this.Interleave                    = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "Interleave");
     this.RequestNoSinglePointOfFailure = SpacesApiUtil.GetManagementObjectValue <bool>(m, "RequestNoSinglePointOfFailure");
     this.Access                        = (AccessEnum)Enum.ToObject(typeof(AccessEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "Access"));
     this.IsSnapshot                    = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsSnapshot");
     this.IsManualAttach                = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsManualAttach");
     this.IsDeduplicationEnabled        = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsDeduplicationEnabled");
     this.IsEnclosureAware              = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsEnclosureAware");
     this.NumberOfAvailableCopies       = SpacesApiUtil.GetManagementObjectValue <ushort>(m, "NumberOfAvailableCopies");
     this.DetachedReason                = (DetachedReasonEnum)Enum.ToObject(typeof(DetachedReasonEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "DetachedReason"));
 }
Ejemplo n.º 2
0
 public override void FromManagementObject(ManagementObject m)
 {
     base.FromManagementObject(m);
     this.FriendlyName                      = SpacesApiUtil.GetManagementObjectValue <string>(m, "FriendlyName");
     this.Name                              = SpacesApiUtil.GetManagementObjectValue <string>(m, "Name");
     this.OtherUsageDescription             = SpacesApiUtil.GetManagementObjectValue <string>(m, "OtherUsageDescription");
     this.Usage                             = (PoolUsage)Enum.ToObject(typeof(PoolUsage), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "Usage"));
     this.IsPrimordial                      = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsPrimordial");
     this.HealthStatus                      = (HealthStatusEnum)Enum.ToObject(typeof(HealthStatusEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "HealthStatus"));
     this.OperationalStatus                 = SpacesApiUtil.ManagementObjectArrayToList <OperationalStatusEnum, ushort>(m["OperationalStatus"]);
     this.OtherOperationalStatusDescription = SpacesApiUtil.GetManagementObjectValue <string>(m, "OtherOperationalStatusDescription");
     this.Size                              = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "Size");
     this.AllocatedSize                     = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "AllocatedSize");
     this.PhysicalSectorSize                = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "PhysicalSectorSize");
     this.LogicalSectorSize                 = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "LogicalSectorSize");
     this.ProvisioningTypeDefault           = (ProvisioningTypeEnum)Enum.ToObject(typeof(ProvisioningTypeEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "ProvisioningTypeDefault"));
     this.SupportedProvisioningTypes        = SpacesApiUtil.ManagementObjectArrayToList <ProvisioningTypeEnum, ushort>(m["SupportedProvisioningTypes"]);
     this.ResiliencySettingNameDefault      = SpacesApiUtil.GetManagementObjectValue <string>(m, "ResiliencySettingNameDefault");
     this.IsReadOnly                        = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsReadOnly");
     this.ReadOnlyReason                    = (DetachedReasonEnum)Enum.ToObject(typeof(DetachedReasonEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "ReadOnlyReason"));
     this.SupportsDeduplication             = SpacesApiUtil.GetManagementObjectValue <bool>(m, "SupportsDeduplication");
     this.IsClustered                       = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsClustered");
     this.ThinProvisioningAlertThresholds   = SpacesApiUtil.ManagementObjectArrayToList <ushort, ushort>(m["ThinProvisioningAlertThresholds"]);
     this.ClearOnDeallocate                 = SpacesApiUtil.GetManagementObjectValue <bool>(m, "ClearOnDeallocate");
     this.IsPowerProtected                  = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsPowerProtected");
     this.EnclosureAwareDefault             = SpacesApiUtil.GetManagementObjectValue <bool>(m, "EnclosureAwareDefault");
     this.RetireMissingPhysicalDisks        = (RetireMissingPhysicalDisksEnum)Enum.ToObject(typeof(RetireMissingPhysicalDisksEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "RetireMissingPhysicalDisks"));
 }
Ejemplo n.º 3
0
 public override void FromManagementObject(ManagementObject m)
 {
     base.FromManagementObject(m);
     this.DeviceId          = SpacesApiUtil.GetManagementObjectValue <string>(m, "DeviceId");
     this.FriendlyName      = SpacesApiUtil.GetManagementObjectValue <string>(m, "FriendlyName");
     this.Usage             = (StorageUsage)Enum.ToObject(typeof(StorageUsage), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "Usage"));
     this.Description       = SpacesApiUtil.GetManagementObjectValue <string>(m, "Description");
     this.Manufacturer      = SpacesApiUtil.GetManagementObjectValue <string>(m, "Manufacturer");
     this.Model             = SpacesApiUtil.GetManagementObjectValue <string>(m, "Model");
     this.SerialNumber      = SpacesApiUtil.GetManagementObjectValue <string>(m, "SerialNumber").Trim();
     this.FirmwareVersion   = SpacesApiUtil.GetManagementObjectValue <string>(m, "FirmwareVersion");
     this.OperationalStatus = SpacesApiUtil.ManagementObjectArrayToList <OperationalStatusEnum, ushort>(m["OperationalStatus"]);
     this.HealthStatus      = (HealthStatusEnum)Enum.ToObject(typeof(HealthStatusEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "HealthStatus"));
     this.Size               = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "Size");
     this.AllocatedSize      = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "AllocatedSize");
     this.BusType            = (BusTypeEnum)Enum.ToObject(typeof(BusTypeEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "BusType"));
     this.PhysicalSectorSize = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "PhysicalSectorSize");
     this.LogicalSectorSize  = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "LogicalSectorSize");
     this.PhysicalLocation   = SpacesApiUtil.GetManagementObjectValue <string>(m, "PhysicalLocation");
     this.EnclosureNumber    = SpacesApiUtil.GetManagementObjectValue <ushort>(m, "EnclosureNumber");
     this.SlotNumber         = SpacesApiUtil.GetManagementObjectValue <ushort>(m, "SlotNumber");
     this.CanPool            = SpacesApiUtil.GetManagementObjectValue <bool>(m, "CanPool");
     this.CannotPoolReasons  = SpacesApiUtil.ManagementObjectArrayToList <CannotPoolReasonEnum, ushort>(m["CannotPoolReason"]);
     this.IsPartial          = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsPartial");
 }
Ejemplo n.º 4
0
 public override void FromManagementObject(ManagementObject m)
 {
     base.FromManagementObject(m);
     this.DiskNumber        = SpacesApiUtil.GetManagementObjectValue <uint>(m, "DiskNumber");
     this.PartitionNumber   = SpacesApiUtil.GetManagementObjectValue <uint>(m, "PartitionNumber");
     this.DriveLetter       = SpacesApiUtil.GetManagementObjectValue <char>(m, "DriveLetter");
     this.AccessPaths       = SpacesApiUtil.ManagementObjectArrayToList <string, string>(m["AccessPaths"]);
     this.OperationalStatus = (DiskOperationalStatusEnum)Enum.ToObject(typeof(DiskOperationalStatusEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "OperationalStatus"));
     this.TransitionState   = (PartitionTransitionStateEnum)Enum.ToObject(typeof(PartitionTransitionStateEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "TransitionState"));
     this.Offset            = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "Offset");
     this.Size                 = SpacesApiUtil.GetManagementObjectValue <ulong>(m, "Size");
     this.MbrType              = (MbrTypeEnum)Enum.ToObject(typeof(MbrTypeEnum), SpacesApiUtil.GetManagementObjectValue <ushort>(m, "MbrType"));
     this.GptType              = SpacesApiUtil.GetManagementObjectValue <string>(m, "GptType");
     this.Guid                 = SpacesApiUtil.GetManagementObjectValue <string>(m, "Guid");
     this.IsReadOnly           = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsReadOnly");
     this.IsOffline            = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsOffline");
     this.IsSystem             = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsSystem");
     this.IsBoot               = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsBoot");
     this.IsActive             = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsActive");
     this.IsHidden             = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsHidden");
     this.IsShadowCopy         = SpacesApiUtil.GetManagementObjectValue <bool>(m, "IsShadowCopy");
     this.NoDefaultDriveLetter = SpacesApiUtil.GetManagementObjectValue <bool>(m, "NoDefaultDriveLetter");
 }