public bool SetOption(KeystoneOptionType type, uint value) { KeystoneError result = KeystoneImports.SetOption(this.engine, type, (IntPtr)(long)value); if (result == KeystoneError.KS_ERR_OK) { return(true); } if (this.throwOnError) { throw new InvalidOperationException(string.Format("Error while setting option in keystone: {0}", (object)Keystone.ErrorToString(result))); } return(false); }
/// <summary> /// Set an option in the engine. /// </summary> /// <param name="type">Type of option</param> /// <param name="value">Value</param> /// <returns>True is the option is correctly setted, False otherwise && throwOnError is false.</returns> /// <exception cref="InvalidOperationException">If Keystone return an error && throwOnError is true</exception> public bool SetOption(KeystoneOptionType type, uint value) { var result = KeystoneImports.SetOption(engine, type, (IntPtr)value); if (result != KeystoneError.KS_ERR_OK) { if (throwOnError) { throw new InvalidOperationException($"Error while setting option in keystone: {ErrorToString(result)}"); } return(false); } return(true); }