Exemplo n.º 1
0
 public HvVirtualMachine(CimInstance instance)
 {
     CimMetadata = new CimMetadata(instance);
     VMGuid      = new Guid(instance.CimInstanceProperties["Name"].Value.ToString());
     DisplayName = instance.CimInstanceProperties["ElementName"].Value.ToString();
     InstallDate = (DateTime)instance.CimInstanceProperties["InstallDate"].Value;
     TimeOfLastConfigurationChange = (DateTime)instance.CimInstanceProperties["TimeOfLastConfigurationChange"].Value;
     TimeOfLastStateChange         = (DateTime)instance.CimInstanceProperties["TimeOfLastStateChange"].Value;
 }
        public HvKvpExchangeComponent(CimInstance instance)
        {
            CimMetadata                 = new CimMetadata(instance);
            GuestExchangeItems          = new List <HvKvpExchangeDataItem>();
            GuestIntrinsicExchangeItems = new List <HvKvpExchangeDataItem>();

            var guestExchangeItems = (string[])instance.CimInstanceProperties["GuestExchangeItems"].Value;

            foreach (var itemXml in guestExchangeItems)
            {
                GuestExchangeItems.Add(DeserializeGuestExchangeItemXml(itemXml));
            }

            var guestIntrinsicExchangeItems = (string[])instance.CimInstanceProperties["GuestIntrinsicExchangeItems"].Value;

            foreach (var itemXml in guestIntrinsicExchangeItems)
            {
                GuestIntrinsicExchangeItems.Add(DeserializeGuestExchangeItemXml(itemXml));
            }
        }