public void assign(out PARAMETER_DESCRIPTION publicDesc) { publicDesc.name = MarshallingHelper.stringFromNativeUtf8(this.name); publicDesc.minimum = this.minimum; publicDesc.maximum = this.maximum; publicDesc.type = this.type; }
public USER_PROPERTY createPublic() { USER_PROPERTY result = default(USER_PROPERTY); result.name = MarshallingHelper.stringFromNativeUtf8(this.name); result.type = this.type; switch (this.type) { case USER_PROPERTY_TYPE.INTEGER: result.intValue = this.value.intValue; break; case USER_PROPERTY_TYPE.BOOLEAN: result.boolValue = this.value.boolValue; break; case USER_PROPERTY_TYPE.FLOAT: result.floatValue = this.value.floatValue; break; case USER_PROPERTY_TYPE.STRING: result.stringValue = MarshallingHelper.stringFromNativeUtf8(this.value.stringValue); break; } return(result); }
public static string stringFromNativeUtf8(IntPtr nativeUtf8) { int num = MarshallingHelper.stringLengthUtf8(nativeUtf8); if (num == 0) { return(string.Empty); } byte[] array = new byte[num]; Marshal.Copy(nativeUtf8, array, 0, array.Length); return(Encoding.UTF8.GetString(array, 0, num)); }
public COMMAND_INFO createPublic() { return(new COMMAND_INFO { commandName = MarshallingHelper.stringFromNativeUtf8(this.commandName), parentCommandIndex = this.parentCommandIndex, frameNumber = this.frameNumber, frameTime = this.frameTime, instanceType = this.instanceType, outputType = this.outputType, instanceHandle = this.instanceHandle, outputHandle = this.outputHandle }); }