/// <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); } }
/// <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; } }
/// <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); } }
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); } }
/// <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()); }
/// <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>("Утилиты"); }
/// <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>("Ферма"); }
/// <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>("Сбытница"); }