Beispiel #1
0
        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));
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 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);
 }
Beispiel #6
0
 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);
 }