/// <summary>Set an option on this transaction that takes an integer value</summary>
        /// <param name="option">Option to set</param>
        /// <param name="value">Value of the parameter</param>
        public void SetOption(FdbTransactionOption option, long value)
        {
            EnsureNotFailedOrDisposed();

            if (Logging.On && Logging.IsVerbose)
            {
                Logging.Verbose(this, "SetOption", String.Format("Setting transaction option {0} to {1}", option.ToString(), value));
            }

            // Spec says: "If the option is documented as taking an Int parameter, value must point to a signed 64-bit integer (little-endian), and value_length must be 8."
            var data = Slice.FromFixed64(value);

            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 transaction that does not take any parameter</summary>
        /// <param name="option">Option to set</param>
        public void SetOption(FdbTransactionOption option)
        {
            EnsureNotFailedOrDisposed();

            if (Logging.On && Logging.IsVerbose)
            {
                Logging.Verbose(this, "SetOption", String.Format("Setting transaction option {0}", option.ToString()));
            }

            m_handler.SetOption(option, Slice.Nil);
        }
Exemplo n.º 4
0
		/// <summary>Set an option on this transaction that takes an integer value</summary>
		/// <param name="option">Option to set</param>
		/// <param name="value">Value of the parameter</param>
		public void SetOption(FdbTransactionOption option, long value)
		{
			EnsureNotFailedOrDisposed();

			if (Logging.On && Logging.IsVerbose) Logging.Verbose(this, "SetOption", String.Format("Setting transaction option {0} to {1}", option.ToString(), value));

			// Spec says: "If the option is documented as taking an Int parameter, value must point to a signed 64-bit integer (little-endian), and value_length must be 8."
			var data = Slice.FromFixed64(value);

			m_handler.SetOption(option, data);
		}
Exemplo n.º 5
0
		/// <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);
		}
Exemplo n.º 6
0
		/// <summary>Set an option on this transaction that does not take any parameter</summary>
		/// <param name="option">Option to set</param>
		public void SetOption(FdbTransactionOption option)
		{
			EnsureNotFailedOrDisposed();

			if (Logging.On && Logging.IsVerbose) Logging.Verbose(this, "SetOption", String.Format("Setting transaction option {0}", option.ToString()));

			m_handler.SetOption(option, Slice.Nil);
		}