Beispiel #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!CommonFunctions.SetRoot(txtPath.Text))
            {
                if (CommonFunctions.ErrorMessage != string.Empty)
                {
                    CommonFunctions.ErrMessage(CommonFunctions.ErrorMessage);
                    return;
                }
            }

            this.Close();
        }
Beispiel #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string[] cli = Environment.GetCommandLineArgs();
            if (cli.Length > 1)
            {
                switch (cli[1])
                {
                case "--help":
                {
                    CommonFunctions.ShowHelp("");
                }; break;

                case "--clear":
                {
                    CommonFunctions.ClearConfig();
                }; break;

                case "--setroot":
                {
                    if (cli.Length > 2)
                    {
                        if (!CommonFunctions.SetRoot(cli[2]))
                        {
                            CommonFunctions.ErrMessage("Can't set " +
                                                       cli[2] + " as Roadsend root " +
                                                       CommonFunctions.ErrorMessage);
                        }
                    }
                    else
                    {
                        CommonFunctions.ShowHelp("\n No directory parameter!");
                    }
                }; break;

                default:
                {
                    CommonFunctions.ShowHelp("\n Wrong parameter: " + cli[1]);
                }; break;
                }
            }
            else
            {
                Application.Run(new frmMain());
            }
        }