public CreateProjectDlg() { InitializeComponent(); aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm"; aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic); aHelpProvider.SetHelpKeyword(this, "publishmap.htm"); // TODO Text = MMUtils.GetString("createprojectdlg.title"); lblPlace.Text = MMUtils.GetString("createprojectdlg.lblPlace.text"); lblProjectName.Text = MMUtils.GetString("createprojectdlg.lblProjectName.text"); btnCreate.Text = MMUtils.GetString("createprojectdlg.btnOK.text"); btnCancel.Text = MMUtils.GetString("buttonCancel.text"); lblProjectNameError.Text = ""; using (PlacesDB _db = new PlacesDB()) { DataTable _dt = _db.ExecuteQuery("select * from PLACES"); if (_dt.Rows.Count != 0) { foreach (DataRow _row in _dt.Rows) { comboPlaces.Items.Add(_row["PLACENAME"]); } } } // No places yet if (comboPlaces.Items.Count == 0) { if (MessageBox.Show(MMUtils.GetString("createprojectdlg.noplaces.text"), MMUtils.GetString("createprojectdlg.noplaces.caption"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { this.DialogResult = DialogResult.Cancel; return; } using (Places.NewPlaceDlg _dlg = new Places.NewPlaceDlg()) { if (_dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd)) == DialogResult.Cancel) { this.DialogResult = DialogResult.Cancel; return; } aPlaceName = _dlg.aPlaceName; } comboPlaces.Items.Add(aPlaceName); } comboPlaces.Text = comboPlaces.Items[0].ToString(); }
private void btnOK_Click(object sender, EventArgs e) { this.Visible = false; using (Places.NewPlaceDlg _dlg = new Places.NewPlaceDlg()) { DialogResult _result = _dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd)); if (_result == DialogResult.Cancel) { this.DialogResult = DialogResult.Cancel; } } }
private void LinkNewPlace_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { using (Places.NewPlaceDlg _dlg = new Places.NewPlaceDlg()) { DialogResult _result = _dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd)); if (_result == DialogResult.Cancel) { this.DialogResult = DialogResult.Cancel; } comboPlaces.Items.Add(_dlg.aPlaceName); comboPlaces.SelectedIndex = 0; } }