public static eLeapRS SaveConfigValue(IntPtr hConnection, string key, float value, out UInt32 requestId) { LEAP_VARIANT_VALUE_TYPE valueStruct = new LEAP_VARIANT_VALUE_TYPE(); valueStruct.type = eLeapValueType.eLeapValueType_Float; valueStruct.floatValue = value; return(LeapC.SaveConfigWithValueType(hConnection, key, valueStruct, out requestId)); }
public static eLeapRS SaveConfigValue(IntPtr hConnection, string key, bool value, out UInt32 requestId) { LEAP_VARIANT_VALUE_TYPE valueStruct = new LEAP_VARIANT_VALUE_TYPE(); //This is a C# approximation of a C union valueStruct.type = eLeapValueType.eLeapValueType_Boolean; valueStruct.boolValue = value ? 1 : 0; return(LeapC.SaveConfigWithValueType(hConnection, key, valueStruct, out requestId)); }
private static eLeapRS SaveConfigWithValueType(IntPtr hConnection, string key, LEAP_VARIANT_VALUE_TYPE valueStruct, out UInt32 requestId) { IntPtr configValue = Marshal.AllocHGlobal(Marshal.SizeOf(valueStruct)); eLeapRS callResult = eLeapRS.eLeapRS_UnknownError; try { Marshal.StructureToPtr(valueStruct, configValue, false); callResult = SaveConfigValue(hConnection, key, configValue, out requestId); } finally { Marshal.FreeHGlobal(configValue); } return(callResult); }
private static eLeapRS SaveConfigWithValueType(IntPtr hConnection, string key, LEAP_VARIANT_VALUE_TYPE valueStruct, out UInt32 requestId) { IntPtr configValue = Marshal.AllocHGlobal(Marshal.SizeOf(valueStruct)); eLeapRS callResult = eLeapRS.eLeapRS_UnknownError; try { Marshal.StructureToPtr(valueStruct, configValue, false); callResult = SaveConfigValue(hConnection, key, configValue, out requestId); } finally { Marshal.FreeHGlobal(configValue); } return callResult; }
public static eLeapRS SaveConfigValue(IntPtr hConnection, string key, float value, out UInt32 requestId) { LEAP_VARIANT_VALUE_TYPE valueStruct = new LEAP_VARIANT_VALUE_TYPE(); valueStruct.type = eLeapValueType.eLeapValueType_Float; valueStruct.floatValue = value; return LeapC.SaveConfigWithValueType(hConnection, key, valueStruct, out requestId); }
public static eLeapRS SaveConfigValue(IntPtr hConnection, string key, bool value, out UInt32 requestId) { LEAP_VARIANT_VALUE_TYPE valueStruct = new LEAP_VARIANT_VALUE_TYPE(); //This is a C# approximation of a C union valueStruct.type = eLeapValueType.eLeapValueType_Boolean; valueStruct.boolValue = value ? 1 : 0; return LeapC.SaveConfigWithValueType(hConnection, key, valueStruct, out requestId); }