public static MiResult ClearElementAt(InstanceHandle handle, int _index) { NativeCimInstance instance = CimNativeApi.MarshalledObject.FromPointer <NativeCimInstance> (handle.DangerousGetHandle()); var properties = NativeCimPropertiesHelper.Deserialize(PropertiesOrSystem(instance)); properties.ElementAt(_index).Value = null; instance.Properties = NativeCimPropertiesHelper.Serialize(properties); handle.DangerousSetHandle((IntPtr)CimNativeApi.MarshalledObject.Create <NativeCimInstance>(instance)); return(MiResult.OK); }
public static MiResult AddElement(InstanceHandle handle, string name, object obj, object par, MiFlags miFlags) { NativeCimInstance instance = CimNativeApi.MarshalledObject.FromPointer <NativeCimInstance>(handle.DangerousGetHandle()); NativeCimProperties properties = NativeCimPropertiesHelper.Deserialize(instance.Properties); CimType type = CimConverter.GetCimType(obj.GetType()); properties.Add(new NativeCimProperty { Name = name, Type = type, Origin = "client", IsArray = false, IsLocal = false, Value = obj }); instance.Properties = NativeCimPropertiesHelper.Serialize(properties); handle.DangerousSetHandle((IntPtr)CimNativeApi.MarshalledObject.Create <NativeCimInstance>(instance)); return(MiResult.OK); }
public static MiResult ClearElementAt (InstanceHandle handle, int _index) { NativeCimInstance instance = CimNativeApi.MarshalledObject.FromPointer<NativeCimInstance> (handle.DangerousGetHandle ()); var properties = NativeCimPropertiesHelper.Deserialize (PropertiesOrSystem(instance)); properties.ElementAt(_index).Value = null; instance.Properties = NativeCimPropertiesHelper.Serialize (properties); handle.DangerousSetHandle ((IntPtr)CimNativeApi.MarshalledObject.Create<NativeCimInstance>(instance)); return MiResult.OK; }
public static MiResult AddElement (InstanceHandle handle, string name, object obj, object par, MiFlags miFlags) { NativeCimInstance instance = CimNativeApi.MarshalledObject.FromPointer<NativeCimInstance>(handle.DangerousGetHandle ()); NativeCimProperties properties = NativeCimPropertiesHelper.Deserialize (instance.Properties); CimType type = CimConverter.GetCimType (obj.GetType ()); properties.Add (new NativeCimProperty { Name = name, Type = type, Origin = "client", IsArray = false, IsLocal = false, Value = obj }); instance.Properties = NativeCimPropertiesHelper.Serialize (properties); handle.DangerousSetHandle ((IntPtr)CimNativeApi.MarshalledObject.Create<NativeCimInstance>(instance)); return MiResult.OK; }