/// <summary>
 /// 点击菜单子窗体Dock到夫窗体指定容器panel
 /// </summary>
 /// <param name="frm">子窗体实例</param>
 public void LoadFormToPanel(MainFormBase frm)
 {
     this.panelMain.Controls.Clear();
     //modified by sunhl
     if (this.panelMain.Controls.Contains(frm))
     {
         frm.Show();
         frm.BringToFront();
         this.labelfrmtxt.Text         = frm.Text;
         this.tableLayoutPanel.Visible = (this.panelMain.Controls.Count > 0);
     }
     else
     {
         frm.Location        = new Point(0, 0);
         frm.TopLevel        = false;
         frm.TopMost         = false;
         frm.ControlBox      = false;
         frm.FormBorderStyle = FormBorderStyle.None;
         frm.Dock            = DockStyle.Fill;
         frm.Visible         = true;
         this.panelMain.Controls.Add(frm);
         frm.Show();
         frm.BringToFront();
         this.labelfrmtxt.Text         = frm.Text;
         this.tableLayoutPanel.Visible = (this.panelMain.Controls.Count > 0);
     }
 }
예제 #2
0
파일: Session.cs 프로젝트: daxnet/guluwin
 /// <summary>
 /// Sets the parameter for the session.
 /// </summary>
 /// <param name="_sessionName">Name of the session.</param>
 /// <param name="_parent">The MDI parent form.</param>
 /// <param name="_compilerType">Type of the CodeDom compiler which is used for compiling the scripts.</param>
 /// <remarks>Calls this method when the Gulu program starts. DO NOT call it at anytime in any places of
 /// your program.</remarks>
 public void SetParameter(string _sessionName, MainFormBase _parent, Type _compilerType)
 {
     if (!hasSet__)
     {
         sessionName__  = _sessionName;
         parent__       = _parent;
         compilerType__ = _compilerType;
         hasSet__       = true;
     }
 }
예제 #3
0
        /// <summary>
        /// Initilaizes this instance.
        /// </summary>
        /// <returns></returns>
        public static bool Initilaize(MainFormBase mainForm)
        {
            FormMain    = mainForm;
            appSettings = AppSettings.Create();
            if (!LoadSettings(appSettings.GameConfig))
            {
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// 利用反射恢复上次运行状态

        /// </summary>
        /// <param name="className">类名</param>
        private void showLastState(string className)
        {
            try
            {
                MainFormBase frm = (MainFormBase)System.Activator.CreateInstance(Type.GetType(className));
                LoadFormToPanel(frm);
            }
            catch
            {
                MessageBox.Show("状态恢复失败!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
예제 #5
0
        public AddIns(string path, string storage, MainFormBase.GetAValidDatabase _GetBaseDatabase)
        {
            if (Constants.BLANK == path || Constants.BLANK == storage) {
                throw new Exception("must define a vaild path to search for AddIns and a storage location where their activte status is stored");
            }
            GetBaseDatabase = _GetBaseDatabase;
            dataPath = path;
            DatabaseName = storage;

            if (Directory.Exists (dataPath) == false) {
                Directory.CreateDirectory (dataPath);
            }
        }
예제 #6
0
        /// <summary>
        /// Initilaizes this instance.
        /// </summary>
        /// <param name="form">The form.</param>
        /// <param name="statisticsMenu">The statistics menu.</param>
        public void Initilaize(MainFormBase form, ToolStripMenuItem statisticsMenu)
        {
            form.AddConsole <MiningConsole>("Шахта");

            var statisticsMinerMenu = new ToolStripMenuItem("Шахта");

            statisticsMenu.DropDownItems.Add(statisticsMinerMenu);

            //TODO: Uncomment
            //        statisticsMinerMenu.DropDownItems.Add("Распределение кристалов в шахте")
            //            .BindCommand(new ShowMineDistributionStatisticsCommand());

            //        statisticsMinerMenu.DropDownItems.Add("Суммарная статистика")
            //.BindCommand(new ShowMineTotalStatisticsCommand());
        }
예제 #7
0
 /// <summary>
 /// Initilaizes this instance.
 /// </summary>
 /// <param name="form">The form.</param>
 /// <param name="statisticsMenu">The statistics menu.</param>
 public void Initilaize(MainFormBase form, ToolStripMenuItem statisticsMenu)
 {
     form.AddConsole <AccountantConsole>("Бухгалтерия");
     form.AddConsole <TopSearchConsole>("Поиск в ТОПе");
     form.AddConsole <ToolsConsole>("Утилиты");
 }
예제 #8
0
 /// <summary>
 /// Initilaizes this instance.
 /// </summary>
 /// <param name="form">The form.</param>
 /// <param name="statisticsMenu">The statistics menu.</param>
 public void Initilaize(MainFormBase form, ToolStripMenuItem statisticsMenu)
 {
     form.AddConsole <FightingConsole>("Бодалка");
     form.AddConsole <CowsFarmConsole>("Ферма");
 }
예제 #9
0
 /// <summary>
 /// Initilaizes this instance.
 /// </summary>
 /// <param name="form">The form.</param>
 /// <param name="statisticsMenu">The statistics menu.</param>
 public void Initilaize(MainFormBase form, ToolStripMenuItem statisticsMenu)
 {
     form.AddConsole <TraderConsole>("Сбытница");
 }