/// <summary>Set the value of a network option on the database handler</summary> private static FdbError SetNetworkOption(FdbNetworkOption option, string value) { unsafe { var data = FdbNative.ToNativeString(value, nullTerminated: false); fixed(byte *ptr = data.Array) { return(FdbNative.NetworkSetOption(option, ptr + data.Offset, data.Count)); } } }
/// <summary>Set an option on this database that takes a string value</summary> /// <param name="option">Option to set</param> /// <param name="value">Value of the parameter (can be null)</param> public void SetOption(FdbDatabaseOption option, string value) { ThrowIfDisposed(); if (Logging.On && Logging.IsVerbose) { Logging.Verbose(this, "SetOption", $"Setting database option {option} to '{value ?? "<null>"}'"); } var data = FdbNative.ToNativeString(value, nullTerminated: true); m_handler.SetOption(option, data); }
/// <summary>Set an option on this transaction that takes a string value</summary> /// <param name="option">Option to set</param> /// <param name="value">Value of the parameter (can be null)</param> public void SetOption(FdbTransactionOption option, string value) { EnsureNotFailedOrDisposed(); if (Logging.On && Logging.IsVerbose) { Logging.Verbose(this, "SetOption", String.Format("Setting transaction option {0} to '{1}'", option.ToString(), value ?? "<null>")); } var data = FdbNative.ToNativeString(value, nullTerminated: true); m_handler.SetOption(option, data); }
/// <summary>Set an option on this cluster that takes a string value</summary> /// <param name="option">Option to set</param> /// <param name="value">Value of the parameter (can be null)</param> public void SetOption(FdbClusterOption option, string value) { ThrowIfDisposed(); Fdb.EnsureNotOnNetworkThread(); if (Logging.On && Logging.IsVerbose) { Logging.Verbose(this, "SetOption", $"Setting cluster option {option.ToString()} to '{value ?? "<null>"}'"); } var data = FdbNative.ToNativeString(value, nullTerminated: true); m_handler.SetOption(option, data); }