cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [03/63] [abbrv] Changes for switching all wmi calls to V2 namespace. V1 namespace is deprecated so it is better to be on v2 namespace.
Date Mon, 04 Nov 2013 23:50:51 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1601498b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_VirtualHardDiskSettingData.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_VirtualHardDiskSettingData.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_VirtualHardDiskSettingData.cs
new file mode 100755
index 0000000..38760cf
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_VirtualHardDiskSettingData.cs
@@ -0,0 +1,1034 @@
+´╗┐namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
+    using System;
+    using System.ComponentModel;
+    using System.Management;
+    using System.Collections;
+    using System.Globalization;
+    using System.ComponentModel.Design.Serialization;
+    using System.Reflection;
+    
+    
+    // Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
+    // Functions Is<PropertyName>Null() are used to check if a property is NULL.
+    // Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
+    // Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
+    // An Early Bound class generated for the WMI class.Msvm_VirtualHardDiskSettingData
+    public class VirtualHardDiskSettingData : System.ComponentModel.Component {
+        
+        // Private property to hold the WMI namespace in which the class resides.
+        private static string CreatedWmiNamespace = "ROOT\\virtualization\\v2";
+        
+        // Private property to hold the name of WMI class which created this class.
+        private static string CreatedClassName = "Msvm_VirtualHardDiskSettingData";
+        
+        // Private member variable to hold the ManagementScope which is used by the various methods.
+        private static System.Management.ManagementScope statMgmtScope = null;
+        
+        private ManagementSystemProperties PrivateSystemProperties;
+        
+        // Underlying lateBound WMI object.
+        private System.Management.ManagementObject PrivateLateBoundObject;
+        
+        // Member variable to store the 'automatic commit' behavior for the class.
+        private bool AutoCommitProp;
+        
+        // Private variable to hold the embedded property representing the instance.
+        private System.Management.ManagementBaseObject embeddedObj;
+        
+        // The current WMI object used
+        private System.Management.ManagementBaseObject curObj;
+        
+        // Flag to indicate if the instance is an embedded object.
+        private bool isEmbedded;
+        
+        // Below are different overloads of constructors to initialize an instance of the class with a WMI object.
+        public VirtualHardDiskSettingData() {
+            this.InitializeObject(null, null, null);
+        }
+        
+        public VirtualHardDiskSettingData(string keyInstanceID) {
+            this.InitializeObject(null, new System.Management.ManagementPath(VirtualHardDiskSettingData.ConstructPath(keyInstanceID)), null);
+        }
+        
+        public VirtualHardDiskSettingData(System.Management.ManagementScope mgmtScope, string keyInstanceID) {
+            this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(VirtualHardDiskSettingData.ConstructPath(keyInstanceID)), null);
+        }
+        
+        public VirtualHardDiskSettingData(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
+            this.InitializeObject(null, path, getOptions);
+        }
+        
+        public VirtualHardDiskSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
+            this.InitializeObject(mgmtScope, path, null);
+        }
+        
+        public VirtualHardDiskSettingData(System.Management.ManagementPath path) {
+            this.InitializeObject(null, path, null);
+        }
+        
+        public VirtualHardDiskSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
+            this.InitializeObject(mgmtScope, path, getOptions);
+        }
+        
+        public VirtualHardDiskSettingData(System.Management.ManagementObject theObject) {
+            Initialize();
+            if ((CheckIfProperClass(theObject) == true)) {
+                PrivateLateBoundObject = theObject;
+                PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
+                curObj = PrivateLateBoundObject;
+            }
+            else {
+                throw new System.ArgumentException("Class name does not match.");
+            }
+        }
+        
+        public VirtualHardDiskSettingData(System.Management.ManagementBaseObject theObject) {
+            Initialize();
+            if ((CheckIfProperClass(theObject) == true)) {
+                embeddedObj = theObject;
+                PrivateSystemProperties = new ManagementSystemProperties(theObject);
+                curObj = embeddedObj;
+                isEmbedded = true;
+            }
+            else {
+                throw new System.ArgumentException("Class name does not match.");
+            }
+        }
+        
+        // Property returns the namespace of the WMI class.
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public string OriginatingNamespace {
+            get {
+                return "ROOT\\virtualization\\v2";
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public string ManagementClassName {
+            get {
+                string strRet = CreatedClassName;
+                if ((curObj != null)) {
+                    if ((curObj.ClassPath != null)) {
+                        strRet = ((string)(curObj["__CLASS"]));
+                        if (((strRet == null) 
+                                    || (strRet == string.Empty))) {
+                            strRet = CreatedClassName;
+                        }
+                    }
+                }
+                return strRet;
+            }
+        }
+        
+        // Property pointing to an embedded object to get System properties of the WMI object.
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public ManagementSystemProperties SystemProperties {
+            get {
+                return PrivateSystemProperties;
+            }
+        }
+        
+        // Property returning the underlying lateBound object.
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public System.Management.ManagementBaseObject LateBoundObject {
+            get {
+                return curObj;
+            }
+        }
+        
+        // ManagementScope of the object.
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public System.Management.ManagementScope Scope {
+            get {
+                if ((isEmbedded == false)) {
+                    return PrivateLateBoundObject.Scope;
+                }
+                else {
+                    return null;
+                }
+            }
+            set {
+                if ((isEmbedded == false)) {
+                    PrivateLateBoundObject.Scope = value;
+                }
+            }
+        }
+        
+        // Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public bool AutoCommit {
+            get {
+                return AutoCommitProp;
+            }
+            set {
+                AutoCommitProp = value;
+            }
+        }
+        
+        // The ManagementPath of the underlying WMI object.
+        [Browsable(true)]
+        public System.Management.ManagementPath Path {
+            get {
+                if ((isEmbedded == false)) {
+                    return PrivateLateBoundObject.Path;
+                }
+                else {
+                    return null;
+                }
+            }
+            set {
+                if ((isEmbedded == false)) {
+                    if ((CheckIfProperClass(null, value, null) != true)) {
+                        throw new System.ArgumentException("Class name does not match.");
+                    }
+                    PrivateLateBoundObject.Path = value;
+                }
+            }
+        }
+        
+        // Public static scope property which is used by the various methods.
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public static System.Management.ManagementScope StaticScope {
+            get {
+                return statMgmtScope;
+            }
+            set {
+                statMgmtScope = value;
+            }
+        }
+        
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public bool IsBlockSizeNull {
+            get {
+                if ((curObj["BlockSize"] == null)) {
+                    return true;
+                }
+                else {
+                    return false;
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        [Description("The block size used by the virtual hard disk")]
+        [TypeConverter(typeof(WMIValueTypeConverter))]
+        public uint BlockSize {
+            get {
+                if ((curObj["BlockSize"] == null)) {
+                    return System.Convert.ToUInt32(0);
+                }
+                return ((uint)(curObj["BlockSize"]));
+            }
+            set {
+                curObj["BlockSize"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public string Caption {
+            get {
+                return ((string)(curObj["Caption"]));
+            }
+            set {
+                curObj["Caption"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public string Description {
+            get {
+                return ((string)(curObj["Description"]));
+            }
+            set {
+                curObj["Description"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public string ElementName {
+            get {
+                return ((string)(curObj["ElementName"]));
+            }
+            set {
+                curObj["ElementName"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public bool IsFormatNull {
+            get {
+                if ((curObj["Format"] == null)) {
+                    return true;
+                }
+                else {
+                    return false;
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        [Description("The format for the virtual hard disk.")]
+        [TypeConverter(typeof(WMIValueTypeConverter))]
+        public FormatValues Format {
+            get {
+                if ((curObj["Format"] == null)) {
+                    return ((FormatValues)(System.Convert.ToInt32(0)));
+                }
+                return ((FormatValues)(System.Convert.ToInt32(curObj["Format"])));
+            }
+            set {
+                if ((FormatValues.NULL_ENUM_VALUE == value)) {
+                    curObj["Format"] = null;
+                }
+                else {
+                    curObj["Format"] = value;
+                }
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public string InstanceID {
+            get {
+                return ((string)(curObj["InstanceID"]));
+            }
+            set {
+                curObj["InstanceID"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public bool IsLogicalSectorSizeNull {
+            get {
+                if ((curObj["LogicalSectorSize"] == null)) {
+                    return true;
+                }
+                else {
+                    return false;
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        [Description("The logical sector size used by the virtual hard disk")]
+        [TypeConverter(typeof(WMIValueTypeConverter))]
+        public uint LogicalSectorSize {
+            get {
+                if ((curObj["LogicalSectorSize"] == null)) {
+                    return System.Convert.ToUInt32(0);
+                }
+                return ((uint)(curObj["LogicalSectorSize"]));
+            }
+            set {
+                curObj["LogicalSectorSize"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public bool IsMaxInternalSizeNull {
+            get {
+                if ((curObj["MaxInternalSize"] == null)) {
+                    return true;
+                }
+                else {
+                    return false;
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        [Description("The maximum size of the virtual hard disk as viewable by the virtual machine, in " +
+            "bytes. The specified size will be rounded up to the next largest multiple of the" +
+            " sector size.")]
+        [TypeConverter(typeof(WMIValueTypeConverter))]
+        public ulong MaxInternalSize {
+            get {
+                if ((curObj["MaxInternalSize"] == null)) {
+                    return System.Convert.ToUInt64(0);
+                }
+                return ((ulong)(curObj["MaxInternalSize"]));
+            }
+            set {
+                curObj["MaxInternalSize"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        [Description("The parent of the virtual hard disk. If the virtual hard disk does not have a par" +
+            "ent, then this field is empty.")]
+        public string ParentPath {
+            get {
+                return ((string)(curObj["ParentPath"]));
+            }
+            set {
+                curObj["ParentPath"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        [Description("The path of the virtual hard disk.")]
+        public string Path0 {
+            get {
+                return ((string)(curObj["Path"]));
+            }
+            set {
+                curObj["Path"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public bool IsPhysicalSectorSizeNull {
+            get {
+                if ((curObj["PhysicalSectorSize"] == null)) {
+                    return true;
+                }
+                else {
+                    return false;
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        [Description("The physical sector size used by the virtual hard disk")]
+        [TypeConverter(typeof(WMIValueTypeConverter))]
+        public uint PhysicalSectorSize {
+            get {
+                if ((curObj["PhysicalSectorSize"] == null)) {
+                    return System.Convert.ToUInt32(0);
+                }
+                return ((uint)(curObj["PhysicalSectorSize"]));
+            }
+            set {
+                curObj["PhysicalSectorSize"] = value;
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public bool IsTypeNull {
+            get {
+                if ((curObj["Type"] == null)) {
+                    return true;
+                }
+                else {
+                    return false;
+                }
+            }
+        }
+        
+        [Browsable(true)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        [Description("The type of virtual hard disk.")]
+        [TypeConverter(typeof(WMIValueTypeConverter))]
+        public TypeValues Type {
+            get {
+                if ((curObj["Type"] == null)) {
+                    return ((TypeValues)(System.Convert.ToInt32(0)));
+                }
+                return ((TypeValues)(System.Convert.ToInt32(curObj["Type"])));
+            }
+            set {
+                if ((TypeValues.NULL_ENUM_VALUE == value)) {
+                    curObj["Type"] = null;
+                }
+                else {
+                    curObj["Type"] = value;
+                }
+                if (((isEmbedded == false) 
+                            && (AutoCommitProp == true))) {
+                    PrivateLateBoundObject.Put();
+                }
+            }
+        }
+        
+        private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
+            if (((path != null) 
+                        && (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
+                return true;
+            }
+            else {
+                return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
+            }
+        }
+        
+        private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
+            if (((theObj != null) 
+                        && (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
+                return true;
+            }
+            else {
+                System.Array parentClasses = ((System.Array)(theObj["__DERIVATION"]));
+                if ((parentClasses != null)) {
+                    int count = 0;
+                    for (count = 0; (count < parentClasses.Length); count = (count + 1)) {
+                        if ((string.Compare(((string)(parentClasses.GetValue(count))), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0)) {
+                            return true;
+                        }
+                    }
+                }
+            }
+            return false;
+        }
+        
+        private bool ShouldSerializeBlockSize() {
+            if ((this.IsBlockSizeNull == false)) {
+                return true;
+            }
+            return false;
+        }
+        
+        private void ResetBlockSize() {
+            curObj["BlockSize"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private void ResetCaption() {
+            curObj["Caption"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private void ResetDescription() {
+            curObj["Description"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private void ResetElementName() {
+            curObj["ElementName"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private bool ShouldSerializeFormat() {
+            if ((this.IsFormatNull == false)) {
+                return true;
+            }
+            return false;
+        }
+        
+        private void ResetFormat() {
+            curObj["Format"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private bool ShouldSerializeLogicalSectorSize() {
+            if ((this.IsLogicalSectorSizeNull == false)) {
+                return true;
+            }
+            return false;
+        }
+        
+        private void ResetLogicalSectorSize() {
+            curObj["LogicalSectorSize"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private bool ShouldSerializeMaxInternalSize() {
+            if ((this.IsMaxInternalSizeNull == false)) {
+                return true;
+            }
+            return false;
+        }
+        
+        private void ResetMaxInternalSize() {
+            curObj["MaxInternalSize"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private void ResetParentPath() {
+            curObj["ParentPath"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private void ResetPath0() {
+            curObj["Path"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private bool ShouldSerializePhysicalSectorSize() {
+            if ((this.IsPhysicalSectorSizeNull == false)) {
+                return true;
+            }
+            return false;
+        }
+        
+        private void ResetPhysicalSectorSize() {
+            curObj["PhysicalSectorSize"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        private bool ShouldSerializeType() {
+            if ((this.IsTypeNull == false)) {
+                return true;
+            }
+            return false;
+        }
+        
+        private void ResetType() {
+            curObj["Type"] = null;
+            if (((isEmbedded == false) 
+                        && (AutoCommitProp == true))) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        [Browsable(true)]
+        public void CommitObject() {
+            if ((isEmbedded == false)) {
+                PrivateLateBoundObject.Put();
+            }
+        }
+        
+        [Browsable(true)]
+        public void CommitObject(System.Management.PutOptions putOptions) {
+            if ((isEmbedded == false)) {
+                PrivateLateBoundObject.Put(putOptions);
+            }
+        }
+        
+        private void Initialize() {
+            AutoCommitProp = true;
+            isEmbedded = false;
+        }
+        
+        private static string ConstructPath(string keyInstanceID) {
+            string strPath = "ROOT\\virtualization\\v2:Msvm_VirtualHardDiskSettingData";
+            strPath = string.Concat(strPath, string.Concat(".InstanceID=", string.Concat("\"", string.Concat(keyInstanceID, "\""))));
+            return strPath;
+        }
+        
+        private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
+            Initialize();
+            if ((path != null)) {
+                if ((CheckIfProperClass(mgmtScope, path, getOptions) != true)) {
+                    throw new System.ArgumentException("Class name does not match.");
+                }
+            }
+            PrivateLateBoundObject = new System.Management.ManagementObject(mgmtScope, path, getOptions);
+            PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
+            curObj = PrivateLateBoundObject;
+        }
+        
+        // Different overloads of GetInstances() help in enumerating instances of the WMI class.
+        public static VirtualHardDiskSettingDataCollection GetInstances() {
+            return GetInstances(null, null, null);
+        }
+        
+        public static VirtualHardDiskSettingDataCollection GetInstances(string condition) {
+            return GetInstances(null, condition, null);
+        }
+        
+        public static VirtualHardDiskSettingDataCollection GetInstances(string[] selectedProperties) {
+            return GetInstances(null, null, selectedProperties);
+        }
+        
+        public static VirtualHardDiskSettingDataCollection GetInstances(string condition, string[] selectedProperties) {
+            return GetInstances(null, condition, selectedProperties);
+        }
+        
+        public static VirtualHardDiskSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
+            if ((mgmtScope == null)) {
+                if ((statMgmtScope == null)) {
+                    mgmtScope = new System.Management.ManagementScope();
+                    mgmtScope.Path.NamespacePath = "root\\virtualization\\v2";
+                }
+                else {
+                    mgmtScope = statMgmtScope;
+                }
+            }
+            System.Management.ManagementPath pathObj = new System.Management.ManagementPath();
+            pathObj.ClassName = "Msvm_VirtualHardDiskSettingData";
+            pathObj.NamespacePath = "root\\virtualization\\v2";
+            System.Management.ManagementClass clsObject = new System.Management.ManagementClass(mgmtScope, pathObj, null);
+            if ((enumOptions == null)) {
+                enumOptions = new System.Management.EnumerationOptions();
+                enumOptions.EnsureLocatable = true;
+            }
+            return new VirtualHardDiskSettingDataCollection(clsObject.GetInstances(enumOptions));
+        }
+        
+        public static VirtualHardDiskSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
+            return GetInstances(mgmtScope, condition, null);
+        }
+        
+        public static VirtualHardDiskSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
+            return GetInstances(mgmtScope, null, selectedProperties);
+        }
+        
+        public static VirtualHardDiskSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
+            if ((mgmtScope == null)) {
+                if ((statMgmtScope == null)) {
+                    mgmtScope = new System.Management.ManagementScope();
+                    mgmtScope.Path.NamespacePath = "root\\virtualization\\v2";
+                }
+                else {
+                    mgmtScope = statMgmtScope;
+                }
+            }
+            System.Management.ManagementObjectSearcher ObjectSearcher = new System.Management.ManagementObjectSearcher(mgmtScope, new SelectQuery("Msvm_VirtualHardDiskSettingData", condition, selectedProperties));
+            System.Management.EnumerationOptions enumOptions = new System.Management.EnumerationOptions();
+            enumOptions.EnsureLocatable = true;
+            ObjectSearcher.Options = enumOptions;
+            return new VirtualHardDiskSettingDataCollection(ObjectSearcher.Get());
+        }
+        
+        [Browsable(true)]
+        public static VirtualHardDiskSettingData CreateInstance() {
+            System.Management.ManagementScope mgmtScope = null;
+            if ((statMgmtScope == null)) {
+                mgmtScope = new System.Management.ManagementScope();
+                mgmtScope.Path.NamespacePath = CreatedWmiNamespace;
+            }
+            else {
+                mgmtScope = statMgmtScope;
+            }
+            System.Management.ManagementPath mgmtPath = new System.Management.ManagementPath(CreatedClassName);
+            System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
+            return new VirtualHardDiskSettingData(tmpMgmtClass.CreateInstance());
+        }
+        
+        [Browsable(true)]
+        public void Delete() {
+            PrivateLateBoundObject.Delete();
+        }
+        
+        public enum FormatValues {
+            
+            VHD = 2,
+            
+            VHDX = 3,
+            
+            NULL_ENUM_VALUE = 0,
+        }
+        
+        public enum TypeValues {
+            
+            Fixed = 2,
+            
+            Dynamic = 3,
+            
+            Differencing = 4,
+            
+            NULL_ENUM_VALUE = 0,
+        }
+        
+        // Enumerator implementation for enumerating instances of the class.
+        public class VirtualHardDiskSettingDataCollection : object, ICollection {
+            
+            private ManagementObjectCollection privColObj;
+            
+            public VirtualHardDiskSettingDataCollection(ManagementObjectCollection objCollection) {
+                privColObj = objCollection;
+            }
+            
+            public virtual int Count {
+                get {
+                    return privColObj.Count;
+                }
+            }
+            
+            public virtual bool IsSynchronized {
+                get {
+                    return privColObj.IsSynchronized;
+                }
+            }
+            
+            public virtual object SyncRoot {
+                get {
+                    return this;
+                }
+            }
+            
+            public virtual void CopyTo(System.Array array, int index) {
+                privColObj.CopyTo(array, index);
+                int nCtr;
+                for (nCtr = 0; (nCtr < array.Length); nCtr = (nCtr + 1)) {
+                    array.SetValue(new VirtualHardDiskSettingData(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
+                }
+            }
+            
+            public virtual System.Collections.IEnumerator GetEnumerator() {
+                return new VirtualHardDiskSettingDataEnumerator(privColObj.GetEnumerator());
+            }
+            
+            public class VirtualHardDiskSettingDataEnumerator : object, System.Collections.IEnumerator {
+                
+                private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
+                
+                public VirtualHardDiskSettingDataEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
+                    privObjEnum = objEnum;
+                }
+                
+                public virtual object Current {
+                    get {
+                        return new VirtualHardDiskSettingData(((System.Management.ManagementObject)(privObjEnum.Current)));
+                    }
+                }
+                
+                public virtual bool MoveNext() {
+                    return privObjEnum.MoveNext();
+                }
+                
+                public virtual void Reset() {
+                    privObjEnum.Reset();
+                }
+            }
+        }
+        
+        // TypeConverter to handle null values for ValueType properties
+        public class WMIValueTypeConverter : TypeConverter {
+            
+            private TypeConverter baseConverter;
+            
+            private System.Type baseType;
+            
+            public WMIValueTypeConverter(System.Type inBaseType) {
+                baseConverter = TypeDescriptor.GetConverter(inBaseType);
+                baseType = inBaseType;
+            }
+            
+            public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
+                return baseConverter.CanConvertFrom(context, srcType);
+            }
+            
+            public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
+                return baseConverter.CanConvertTo(context, destinationType);
+            }
+            
+            public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
+                return baseConverter.ConvertFrom(context, culture, value);
+            }
+            
+            public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
+                return baseConverter.CreateInstance(context, dictionary);
+            }
+            
+            public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
+                return baseConverter.GetCreateInstanceSupported(context);
+            }
+            
+            public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
+                return baseConverter.GetProperties(context, value, attributeVar);
+            }
+            
+            public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
+                return baseConverter.GetPropertiesSupported(context);
+            }
+            
+            public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
+                return baseConverter.GetStandardValues(context);
+            }
+            
+            public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
+                return baseConverter.GetStandardValuesExclusive(context);
+            }
+            
+            public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
+                return baseConverter.GetStandardValuesSupported(context);
+            }
+            
+            public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
+                if ((baseType.BaseType == typeof(System.Enum))) {
+                    if ((value.GetType() == destinationType)) {
+                        return value;
+                    }
+                    if ((((value == null) 
+                                && (context != null)) 
+                                && (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
+                        return  "NULL_ENUM_VALUE" ;
+                    }
+                    return baseConverter.ConvertTo(context, culture, value, destinationType);
+                }
+                if (((baseType == typeof(bool)) 
+                            && (baseType.BaseType == typeof(System.ValueType)))) {
+                    if ((((value == null) 
+                                && (context != null)) 
+                                && (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
+                        return "";
+                    }
+                    return baseConverter.ConvertTo(context, culture, value, destinationType);
+                }
+                if (((context != null) 
+                            && (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
+                    return "";
+                }
+                return baseConverter.ConvertTo(context, culture, value, destinationType);
+            }
+        }
+        
+        // Embedded class to represent WMI system Properties.
+        [TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
+        public class ManagementSystemProperties {
+            
+            private System.Management.ManagementBaseObject PrivateLateBoundObject;
+            
+            public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
+                PrivateLateBoundObject = ManagedObject;
+            }
+            
+            [Browsable(true)]
+            public int GENUS {
+                get {
+                    return ((int)(PrivateLateBoundObject["__GENUS"]));
+                }
+            }
+            
+            [Browsable(true)]
+            public string CLASS {
+                get {
+                    return ((string)(PrivateLateBoundObject["__CLASS"]));
+                }
+            }
+            
+            [Browsable(true)]
+            public string SUPERCLASS {
+                get {
+                    return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
+                }
+            }
+            
+            [Browsable(true)]
+            public string DYNASTY {
+                get {
+                    return ((string)(PrivateLateBoundObject["__DYNASTY"]));
+                }
+            }
+            
+            [Browsable(true)]
+            public string RELPATH {
+                get {
+                    return ((string)(PrivateLateBoundObject["__RELPATH"]));
+                }
+            }
+            
+            [Browsable(true)]
+            public int PROPERTY_COUNT {
+                get {
+                    return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
+                }
+            }
+            
+            [Browsable(true)]
+            public string[] DERIVATION {
+                get {
+                    return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
+                }
+            }
+            
+            [Browsable(true)]
+            public string SERVER {
+                get {
+                    return ((string)(PrivateLateBoundObject["__SERVER"]));
+                }
+            }
+            
+            [Browsable(true)]
+            public string NAMESPACE {
+                get {
+                    return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
+                }
+            }
+            
+            [Browsable(true)]
+            public string PATH {
+                get {
+                    return ((string)(PrivateLateBoundObject["__PATH"]));
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1601498b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_VirtualSystemManagementService.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_VirtualSystemManagementService.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_VirtualSystemManagementService.cs
index b5da7f6..72a7b90 100755
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_VirtualSystemManagementService.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_VirtualSystemManagementService.cs
@@ -1006,13 +1006,13 @@
                 inParams["FeatureSettings"] = ((string[])(FeatureSettings));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("AddFeatureSettings", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 ResultingFeatureSettings = null;
-                if ((outParams.Properties["ResultingFeatureSettings"] != null)) {
+                if ((outParams.Properties["ResultingFeatureSettings"] != null && outParams.Properties["ResultingFeatureSettings"].Value != null))
+                {
                     int len = ((System.Array)(outParams.Properties["ResultingFeatureSettings"].Value)).Length;
                     System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
                     for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
@@ -1052,11 +1052,9 @@
                 inParams["TargetSystem"] = ((System.Management.ManagementPath)(TargetSystem)).Path;
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("AddKvpItems", inParams, null);
                 Job = null;
-//                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-//                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
-                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1074,13 +1072,13 @@
                 inParams["ResourceSettings"] = ((string[])(ResourceSettings));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("AddResourceSettings", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 ResultingResourceSettings = null;
-                if ((outParams.Properties["ResultingResourceSettings"] != null)) {
+                if ((outParams.Properties["ResultingResourceSettings"] != null && outParams.Properties["ResultingResourceSettings"].Value != null))
+                {
                     int len = ((System.Array)(outParams.Properties["ResultingResourceSettings"].Value)).Length;
                     System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
                     for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
@@ -1097,23 +1095,23 @@
             }
         }
         
-        public uint DefineSystem(System.Management.ManagementPath ReferenceConfiguration, string[] ResourceSettings, string SystemSettings, out System.Management.ManagementPath Job, out System.Management.ManagementPath ResultingSystem) {
+        public uint DefineSystem(string ReferenceConfigurationPath, string[] ResourceSettings, string SystemSettings, out System.Management.ManagementPath Job, out System.Management.ManagementPath ResultingSystem) {
             if ((isEmbedded == false)) {
                 System.Management.ManagementBaseObject inParams = null;
                 inParams = PrivateLateBoundObject.GetMethodParameters("DefineSystem");
-                inParams["ReferenceConfiguration"] = ((System.Management.ManagementPath)(ReferenceConfiguration)).Path;
-                inParams["ResourceSettings"] = ((string[])(ResourceSettings));
-                inParams["SystemSettings"] = ((string)(SystemSettings));
+                inParams["ReferenceConfiguration"] = ReferenceConfigurationPath;
+                inParams["ResourceSettings"] = ResourceSettings;
+                inParams["SystemSettings"] = SystemSettings;
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("DefineSystem", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null) && outParams.Properties["Job"].Value != null)
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 ResultingSystem = null;
-                if ((outParams.Properties["ResultingSystem"] != null)) {
-                    ResultingSystem = new System.Management.ManagementPath(outParams.Properties["ResultingSystem"].ToString());
+                if ((outParams.Properties["ResultingSystem"] != null && outParams.Properties["ResultingSystem"].Value != null))
+                {
+                    ResultingSystem = new System.Management.ManagementPath((string)outParams.Properties["ResultingSystem"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1131,10 +1129,9 @@
                 inParams["AffectedSystem"] = ((System.Management.ManagementPath)(AffectedSystem)).Path;
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("DestroySystem", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1153,11 +1150,11 @@
                 inParams["ExportSettingData"] = ((string)(ExportSettingData));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ExportSystemDefinition", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
+
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
             else {
@@ -1290,7 +1287,8 @@
                 inParams["SnapshotFolder"] = ((string)(SnapshotFolder));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ImportSnapshotDefinitions", inParams, null);
                 ImportedSnapshots = null;
-                if ((outParams.Properties["ImportedSnapshots"] != null)) {
+                if ((outParams.Properties["ImportedSnapshots"] != null && outParams.Properties["ImportedSnapshots"].Value != null))
+                {
                     int len = ((System.Array)(outParams.Properties["ImportedSnapshots"].Value)).Length;
                     System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
                     for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
@@ -1299,10 +1297,9 @@
                     ImportedSnapshots = arrToRet;
                 }
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1322,15 +1319,16 @@
                 inParams["SystemDefinitionFile"] = ((string)(SystemDefinitionFile));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ImportSystemDefinition", inParams, null);
                 ImportedSystem = null;
-                if ((outParams.Properties["ImportedSystem"] != null)) {
+                if ((outParams.Properties["ImportedSystem"] != null && outParams.Properties["ImportedSystem"].Value != null))
+                {
                     ImportedSystem = new System.Management.ManagementPath(outParams.Properties["ImportedSystem"].ToString());
                 }
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
+
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
             else {
@@ -1347,10 +1345,9 @@
                 inParams["SettingData"] = ((string)(SettingData));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyDiskMergeSettings", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1367,13 +1364,13 @@
                 inParams["FeatureSettings"] = ((string[])(FeatureSettings));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyFeatureSettings", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 ResultingFeatureSettings = null;
-                if ((outParams.Properties["ResultingFeatureSettings"] != null)) {
+                if ((outParams.Properties["ResultingFeatureSettings"] != null && outParams.Properties["ResultingFeatureSettings"].Value != null))
+                {
                     int len = ((System.Array)(outParams.Properties["ResultingFeatureSettings"].Value)).Length;
                     System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
                     for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
@@ -1398,10 +1395,9 @@
                 inParams["TargetSystem"] = ((System.Management.ManagementPath)(TargetSystem)).Path;
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyKvpItems", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1418,13 +1414,13 @@
                 inParams["ResourceSettings"] = ((string[])(ResourceSettings));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyResourceSettings", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null) && outParams.Properties["Job"].Value != null)
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 ResultingResourceSettings = null;
-                if ((outParams.Properties["ResultingResourceSettings"] != null)) {
+                if ((outParams.Properties["ResultingResourceSettings"] != null && outParams.Properties["ResultingResourceSettings"].Value != null))
+                {
                     int len = ((System.Array)(outParams.Properties["ResultingResourceSettings"].Value)).Length;
                     System.Management.ManagementPath[] arrToRet = new System.Management.ManagementPath[len];
                     for (int iCounter = 0; (iCounter < len); iCounter = (iCounter + 1)) {
@@ -1448,10 +1444,9 @@
                 inParams["SettingData"] = ((string)(SettingData));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifyServiceSettings", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1468,10 +1463,9 @@
                 inParams["SystemSettings"] = ((string)(SystemSettings));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ModifySystemSettings", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1488,10 +1482,9 @@
                 inParams["PlannedSystem"] = ((System.Management.ManagementPath)(PlannedSystem)).Path;
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RealizePlannedSystem", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 ResultingSystem = null;
                 if ((outParams.Properties["ResultingSystem"] != null)) {
@@ -1523,10 +1516,9 @@
                 }
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RemoveFeatureSettings", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1557,11 +1549,9 @@
                 inParams["TargetSystem"] = ((System.Management.ManagementPath)(TargetSystem)).Path;
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RemoveKvpItems", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
-                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1588,11 +1578,9 @@
                 }
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RemoveResourceSettings", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
-                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1610,11 +1598,9 @@
                 inParams["TimeoutPeriod"] = ToDmtfDateTime(((System.DateTime)(TimeoutPeriod)));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("RequestStateChange", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
-                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1632,11 +1618,9 @@
                 inParams["NetworkConfiguration"] = ((string[])(NetworkConfiguration));
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("SetGuestNetworkAdapterConfiguration", inParams, null);
                 Job = null;
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
-                //                if (outParams.Properties["Job"] != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
-                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].Value.ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }
@@ -1675,10 +1659,9 @@
                 inParams["PlannedSystem"] = ((System.Management.ManagementPath)(PlannedSystem)).Path;
                 System.Management.ManagementBaseObject outParams = PrivateLateBoundObject.InvokeMethod("ValidatePlannedSystem", inParams, null);
                 Job = null;
-                //                if (outParams.Properties["Job"] != null)
-                if (outParams.Properties["Job"] != null || outParams.Properties["Job"].Value != null)
+                if ((outParams.Properties["Job"] != null))
                 {
-                    //                    Job = new System.Management.ManagementPath(outParams.Properties["Job"].ToString());
+                    Job = new System.Management.ManagementPath((string)outParams.Properties["Job"].Value);
                 }
                 return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
             }


Mime
View raw message