Example #1
0
 private void contestsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (_contestsForm == null || _contestsForm.IsDisposed)
     {
         _contestsForm = new ContestsForm();
         _contestsForm.Show();
     }
 }
Example #2
0
        /// <summary>
        /// 初始化程序
        /// </summary>
        private void Init()
        {
            FCTB   = fastColoredTextBox_Main;
            acMenu = new AutocompleteMenu(fastColoredTextBox_Main);

            FormCompileErrorInfo = new CompileErrorInfoForm();
            FormMain             = this;

            #region 配置信息
            Config.LoadConfig();           //加载配置信息

            if (Config.MainFormMax == "1") //最大化
            {
                this.WindowState = FormWindowState.Maximized;
            }
            else
            {
                int height, weigh;
                Int32.TryParse(Config.MainFormWidth, out weigh);
                Int32.TryParse(Config.MainFormHeight, out height);
                this.Width  = weigh;
                this.Height = height;
            }

            if (Config.EnableChineseInput == "1")
            {
                fastColoredTextBox_Main.ImeMode = ImeMode.On;
            }
            else
            {
                fastColoredTextBox_Main.ImeMode = ImeMode.NoControl;
            }
            #endregion

            I18N.InitLanguageData();                                                                       //初始化多语言

            InitText();                                                                                    //初始化本窗口语言

            string path = _args.Length == 0 ? FileManager.GetLastOpenFilePath() : String.Join(" ", _args); //获取源文件路径,长度为0代表直接运行IDE,非0代表打开外部源文件

            InitEditor(!path.ToLower().EndsWith("c"));                                                     //初始化编辑框,判断C/C++,默认C++

            LoadData(path);                                                                                //加载源文件

            new System.Threading.Thread(new System.Threading.ThreadStart(() =>
            {
                ContestsForm.InitContestsInfo();//后台预加载竞赛信息
            })).Start();
        }