Example #1
0
        /// <summary>
        /// We are responsible for creating the application's main form in this override.
        /// </summary>
        protected override void OnCreateMainForm()
        {
            // Create an instance of the main form and set it in the application;
            // but don't try to run it.
            try
            {
                this.MainForm = this.mSAapplication.MainForm;

                // We want to pass along the command-line arguments to this first instance
                // Allocate room in our string array
                IAcceptArgument ia = this.MainForm as IAcceptArgument;
                if (ia != null && this.CommandLineArgs.Count > 0)
                {
                    string[] args = new string[this.CommandLineArgs.Count];
                    this.CommandLineArgs.CopyTo(args, 0);
                    ia.Argument(args);
                }
            }
            catch (Exception e)
            {
                string ms = Translator.Instance.T("应用程序初始化失败. 无法继续!");
                ms += "\n\n";
                ms += e.Message;
                //ms += "\n";
                //ms += e.StackTrace;
                MessageBox.Show(ms, this.mSAapplication.FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }