public static string GetCaptionForExecutionOption(ExecutionOption opt)
 {
     switch (opt)
     {
         case ExecutionOption.AlwaysExecute:
             return Properties.AdminUIResources.EXEC_OVERRIDE_ALWAYS_EXECUTE;
         case ExecutionOption.OverridableDefaultFalse:
             return Properties.AdminUIResources.EXEC_OVERRIDE_DEFAULT_FALSE;
         case ExecutionOption.OverridableDefaultTrue:
             return Properties.AdminUIResources.EXEC_OVERRIDE_DEFAULT_TRUE;
         default:
             return string.Empty;
     }
 }
Example #2
0
        public virtual IPipelineBuilder Configure(PSDocumentOption option)
        {
            Option.Document  = DocumentOption.Combine(option.Document, DocumentOption.Default);
            Option.Execution = ExecutionOption.Combine(option.Execution, ExecutionOption.Default);
            Option.Markdown  = MarkdownOption.Combine(option.Markdown, MarkdownOption.Default);
            Option.Output    = OutputOption.Combine(option.Output, OutputOption.Default);

            if (!string.IsNullOrEmpty(Option.Output.Path))
            {
                OutputVisitor = (o, enumerate) => WriteToFile(o, Option, Writer, ShouldProcess);
            }

            ConfigureCulture();
            return(this);
        }
Example #3
0
        internal int RequestExecute(int handle, ExecutionOption flag,
                                    CubridParameter[] parameters, byte[] paramModes, byte fetchFlag, bool autoCommit)
        {
            WriteCommand(FunctionCode.Execute);

            WriteIntArg(handle);
            WriteByteArg((byte)flag);
            WriteIntArg(0); /* max field */
            WriteIntArg(0); /* max fetch size */

            if (paramModes != null)
            {
                WriteByteArg(paramModes);
            }
            else
            {
                WriteNullArg(); /* bind mode */
            }

            WriteByteArg(fetchFlag);                      /* fetch flag */
            WriteByteArg(autoCommit ? (byte)1 : (byte)0); /* auto commit */
            WriteByteArg(1);                              /* not scrollable */
            WriteCacheTime();                             /* cache time */

            /* bind parameter */
            if (parameters != null)
            {
                for (int i = 0; i < parameters.Length; i++)
                {
                    parameters[i].Write(this);
                }
            }

            Flush();

            return(Receive());
        }
Example #4
0
 /// <summary>
 ///     Initialize a new instance of <see cref="UpdateArgument" />
 /// </summary>
 /// <param name="argument">Command-line argument to pass</param>
 /// <param name="executionOption">Configure when the argument should be passed</param>
 public UpdateArgument(string argument, ExecutionOption executionOption)
 {
     Argument        = argument;
     ExecutionOption = executionOption;
 }
Example #5
0
 public ExecutionOptionItem(ExecutionOption option)
 {
     ExecutionOption = option;
 }
Example #6
0
        internal int RequestExecute(int handle, ExecutionOption flag, 
            CubridParameter[] parameters, byte[] paramModes, byte fetchFlag, bool autoCommit)
        {
            WriteCommand(FunctionCode.Execute);

            WriteIntArg(handle);
            WriteByteArg((byte)flag);
            WriteIntArg(0); /* max field */
            WriteIntArg(0); /* max fetch size */
            
            if (paramModes != null)
            {
                WriteByteArg(paramModes);
            }
            else
            {
                WriteNullArg(); /* bind mode */
            }

            WriteByteArg(fetchFlag); /* fetch flag */
            WriteByteArg(autoCommit ? (byte)1 : (byte)0); /* auto commit */
            WriteByteArg(1); /* not scrollable */
            WriteCacheTime(); /* cache time */

            /* bind parameter */
            if (parameters != null)
            {
                for (int i = 0; i < parameters.Length; i++)
                {
                    parameters[i].Write(this);
                }
            }

            Flush();

            return Receive();
        }
Example #7
0
        private void ConnectExecutionOption(ExecutionOption executionOption)
        {
            bool executeValue, executeOverride;
            switch (executionOption)
            {
                case ExecutionOption.AlwaysExecute:
                    executeValue = true;
                    executeOverride = false;
                    break;
                case ExecutionOption.OverridableDefaultFalse:
                    executeValue = false;
                    executeOverride = true;
                    break;
                case ExecutionOption.OverridableDefaultTrue:
                    executeValue = true;
                    executeOverride = true;
                    break;
                default:
                    Debug.Assert(false, "There should only be three cases!");
                    return;
            }

            m_executeOptionElem.Data =
                DataItem.CreateDataItem(new NonTranslateableLanguageItem(String.Empty), DataType.Boolean,
                                        executeValue);

            m_executeOptionElem["allowoverride"].Value = executeOverride.ToString();
        }