Example #1
0
 /// <summary>
 /// 创建操作命令集合对象。
 /// </summary>
 /// <param name="context">操作上下文。</param>
 public OperateCommandCollection(DbOperateContext context)
 {
     _ExecutionMode   = context.Context.Database.Provider.ExecutionMode;
     operationContext = context;
     commands         = new List <OperateCommandBase>();
     CheckParameterCount();
 }
Example #2
0
 /// <summary>
 /// 创建命令对象。
 /// </summary>
 /// <param name="context">操作执行上下文。</param>
 /// <param name="mode">执行模式。</param>
 public SingleOperateCommand(DbOperateContext context, EExecutionMode mode)
     : base(context)
 {
     if (mode == EExecutionMode.SingleOperation)
     {
         ExecuteMode = ECommandExecuteMode.Simple;
     }
     else
     {
         ExecuteMode = ECommandExecuteMode.Split;
     }
 }
        private static void Process_Command_Line_Arguments( string[] arguments )
        {
            foreach ( var argument in arguments )
            {
                string upper_arg = argument.ToUpper();

                if ( upper_arg == "CLEAN" )
                {
                    Mode = EExecutionMode.Clean;
                }
                else if ( upper_arg == "GENCONFIG" )
                {
                    GenerateConfigFile = true;
                }
                else
                {
                    Console.WriteLine( "Unknown command line argument: " + argument );
                }
            }
        }
Example #4
0
        // Methods
        // Private interface
        private static void Process_Command_Line_Arguments( string[] arguments )
        {
            if ( arguments.Length != 3 )
            {
                throw new Exception( "IpCodeGen expects three arguments: execution mode (NORMAL/CLEAN), top level directory path, and solution name" );
            }

            string upper_arg1 = arguments[ 0 ].ToUpper();
            if ( upper_arg1 == "CLEAN" )
            {
                Mode = EExecutionMode.Clean;
            }
            else if ( upper_arg1 == "NORMAL" )
            {
                Mode = EExecutionMode.Normal;
            }
            else
            {
                throw new Exception( "Illegal first argument (execution mode): must be either 'Normal' or 'Clean'" );
            }

            TopLevelDirectory = arguments[ 1 ] + Path.DirectorySeparatorChar;
            SolutionName = arguments[2];
        }