Beispiel #1
0
        private void Initialize(StartupEventArgs e)
        {
            CommandLineOptions = CommandLine.Parse(e.Args);

            if (AppStartup.SingleTaskRequested)
            {
                AppStartup.ProcessRequestedSingleTask(this);
                Application.Current.Shutdown();
            }
            else
            {
                AppStartup.InitializeAndRunApp_Main(this);
            }
        }
        internal static void EnforceConsistency(CommandLineOpts o)
        {
            if (CheckHasDeleteTaskOption(o))
            {
                o.ForceSetTask = false;
                o.SetTaskAskIfNonConsistent = false;
            }

            if (o.AskDeleteTask)
            {
                o.DeleteTask         = false;
                o.SilentlyDeleteTask = false;
            }
            else
            {
                if (o.DeleteTask)
                {
                    o.AskDeleteTask      = false;
                    o.SilentlyDeleteTask = false;
                }
                else
                {
                    if (o.SilentlyDeleteTask)
                    {
                        o.AskDeleteTask = false;
                        o.DeleteTask    = false;
                    }
                }
            }

            if (o.ForceSetTask)
            {
                o.SetTaskAskIfNonConsistent = false;
            }
            else
            {
                if (o.SetTaskAskIfNonConsistent)
                {
                    o.ForceSetTask = false;
                }
            }
        }
 private static bool CheckHasSetTaskOption(CommandLineOpts o)
 {
     return(o.ForceSetTask ||
            o.SetTaskAskIfNonConsistent);
 }
 private static bool CheckHasDeleteTaskOption(CommandLineOpts o)
 {
     return(o.AskDeleteTask ||
            o.DeleteTask ||
            o.SilentlyDeleteTask);
 }