Beispiel #1
0
            public bool Parse(List <string> argv)
            {
                if (ArgParser.Parse(argv, "-classicpreset") < 0)
                {
                    return(false);
                }

                Overridelayout("classic_layout.xreg");

                Helper.WindowsRegistry.Layout.SelectedTheme = 0;
                Helper.WindowsRegistry.AsynchronLoad        = false;
                Helper.WindowsRegistry.DecodeFilenamesState = false;
                Helper.WindowsRegistry.DeepSimScan          = false;
                Helper.WindowsRegistry.DeepSimTemplateScan  = false;

                Helper.WindowsRegistry.SimpleResourceSelect = true;
                Helper.WindowsRegistry.MultipleFiles        = false;
                Helper.WindowsRegistry.FirefoxTabbing       = false;
                Helper.WindowsRegistry.ShowWaitBarPermanent = false;

                Helper.WindowsRegistry.LockDocks = true;
                Helper.WindowsRegistry.Flush();

                System.Windows.Forms.DialogResult dr = Message.Show(SimPe.Localization.GetString("PresetChanged").Replace("{name}", SimPe.Localization.GetString("PresetClassic")),
                                                                    SimPe.Localization.GetString("Information"), System.Windows.Forms.MessageBoxButtons.YesNo);
                return(dr != System.Windows.Forms.DialogResult.Yes);
            }
Beispiel #2
0
 public bool Parse(List <string> argv)
 {
     if (ArgParser.Parse(argv, "--nosplash") >= 0)
     {
         Helper.WindowsRegistry.ShowStartupSplash = false;
     }
     return(false);
 }
Beispiel #3
0
            public bool Parse(List <string> argv)
            {
                if (ArgParser.Parse(argv, "-modernpreset") < 0)
                {
                    return(false);
                }

                ForceModernLayout();

                System.Windows.Forms.DialogResult dr = Message.Show(SimPe.Localization.GetString("PresetChanged").Replace("{name}",
                                                                                                                          SimPe.Localization.GetString("PresetModern")), SimPe.Localization.GetString("Information"),
                                                                    System.Windows.Forms.MessageBoxButtons.YesNo);
                return(dr != System.Windows.Forms.DialogResult.Yes);
            }
Beispiel #4
0
            public bool Parse(List <string> argv)
            {
                int index = ArgParser.Parse(argv, "-profile");

                if (index < 0)
                {
                    return(false);
                }
                if (index >= argv.Count || argv[index].Length == 0)
                {
                    Message.Show(Help()[0]); return(true);
                }
                Helper.Profile = argv[index];
                argv.RemoveAt(index);
                if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(Helper.DataFolder.SimPeXREG)))
                {
                    Message.Show(Help()[0]); return(true);
                }
                return(false);
            }
Beispiel #5
0
        public bool Parse(List <string> argv)
        {
            if (ArgParser.Parse(argv, "-help") < 0)
            {
                return(false);
            }

            string pluginHelp = "";

            foreach (ICommandLine cmdline in Commandline.preSplashCommands)
            {
                string[] help = cmdline.Help();
                pluginHelp += "\r\n" + "  " + help[0];
                if (help[1] != null && help[1].Length > 0)
                {
                    pluginHelp += "\r\n" + "      " + help[1];
                }
            }
            foreach (ICommandLine cmdline in SimPe.FileTable.CommandLineRegistry.CommandLines)
            {
                string[] help = cmdline.Help();
                pluginHelp += "\r\n" + "  " + help[0];
                if (help[1] != null && help[1].Length > 0)
                {
                    pluginHelp += "\r\n" + "      " + help[1];
                }
            }

            SimPe.Splash.Screen.Stop();

            System.Windows.Forms.MessageBox.Show(""
                                                 + pluginHelp
                                                 + "\r\n"
                                                 , "SimPE Commandline Parameters"
                                                 , System.Windows.Forms.MessageBoxButtons.OK
                                                 , System.Windows.Forms.MessageBoxIcon.Information
                                                 );

            return(true);
        }
Beispiel #6
0
            public bool Parse(List <string> argv)
            {
                int i = ArgParser.Parse(argv, "-localmode");

                if (i >= 0)
                {
                    argv.InsertRange(i, new string[] { "-enable", "localmode" });
                }
                i = ArgParser.Parse(argv, "-noplugins");
                if (i >= 0)
                {
                    argv.InsertRange(i, new string[] { "-enable", "noplugins" });
                }

                bool haveEnable = false;
                bool needEnable = true;

                i = ArgParser.Parse(argv, "-enable");
                if (i >= 0)
                {
                    haveEnable = true; needEnable = false;
                }
                else
                {
                    return(false);
                }

                List <string> flags = new List <string>(new string[] { "localmode", "noplugins", "fileformat", "noerrors", "anypackage", });

                while (!needEnable)
                {
                    if (argv.Count <= i)
                    {
                        Message.Show(Help()[0]); return(true);
                    }                                                              // -enable {nothing}
                    switch (ArgParser.Parse(argv, i, flags))
                    {
                    case 0: Helper.LocalMode = true; haveEnable = false; break;

                    case 1: Helper.NoPlugins = true; haveEnable = false; break;

                    case 2: Helper.FileFormat = true; haveEnable = false; break;

                    case 3: Helper.NoErrors = true; haveEnable = false; break;

                    case 4: Helper.AnyPackage = true; haveEnable = false; break;

                    default:
                        if (haveEnable)
                        {
                            Message.Show(Help()[0]); return(true);
                        }                                                             // -enable {unknown}
                        else
                        {
                            needEnable = true; break;
                        }                                      // done one lot of -enables
                    }
                    if (needEnable)
                    {
                        i = ArgParser.Parse(argv, "-enable");
                        if (i >= 0)
                        {
                            haveEnable = true; needEnable = false;
                        }
                    }
                    if (!haveEnable && argv.Count <= i)
                    {
                        break;                                 // processed everything
                    }
                }

                if (Helper.LocalMode || Helper.NoPlugins || Helper.NoErrors)
                {
                    string s = "";
                    if (Helper.LocalMode)
                    {
                        s += Localization.GetString("InLocalMode") + "\r\n";
                    }
                    if (Helper.NoPlugins)
                    {
                        s += "\r\n" + Localization.GetString("NoPlugins") + "\r\n";
                    }
                    if (Helper.NoErrors)
                    {
                        s += "\r\n" + Localization.GetString("NoErrors");
                    }
                    Message.Show(s, "Notice", System.Windows.Forms.MessageBoxButtons.OK);
                }

                return(false); // Don't exit SimPE!
            }