private void _viewModel_DialogActions(object sender, CommandArgs args) { if (args.parameter.Equals("YES")) { switch (_lastCommand) { case "NewDic": CustomDicManage.AddACustomDictionary(_viewModel.NewName); break; case "ReName": CustomDicManage.ChangeDictionaryName(_viewModel.OpenedDic.Name, _viewModel.NewName); break; case "ReMove": WordBook.Custom.Remove(WordBook.Custom[_viewModel.OpenedDic.DBName - 10]); CustomDicManage.DeleteDictionary(_viewModel.OpenedDic.Name); if (WordBook.SelectedDic == _viewModel.OpenedDic.DBName) { WordBook.CustomeDicCounts--; WordBook.SelectedDic = WordBook.CustomeDicCounts > 10 ? WordBook.CustomeDicCounts : 5; } _viewModel.UpdateDicinfo(); VisualStateManager.GoToState(this, "BrifeInfo", true); break; default: break; } } _lastCommand = null; NewDialog.Hide(); MessageDialog.Hide(); }
private async void _viewModel_CommandActions(object sender, CommandArgs args) { _viewModel.NewName = null; _viewModel.Tiptext = "请输入新建词库的名称"; _lastCommand = "NewDic"; var res = await NewDialog.ShowAsync(); }
private async void _viewModel_DicOpAction(object sender, CommandArgs args) { switch (args.command) { case "Open": VisualStateManager.GoToState(this, "CompleteInfo", true); break; case "Close": VisualStateManager.GoToState(this, "BrifeInfo", true); if (!VocabularySemantic.IsZoomedInViewActive) { VocabularySemantic.ToggleActiveView(); } break; case "ReName": _viewModel.NewName = null; _viewModel.Tiptext = "请输入新的词库名称"; _lastCommand = "ReName"; await NewDialog.ShowAsync(); break; case "ReMove": _viewModel.Tiptext = "确认删除吗?"; _lastCommand = "ReMove"; await MessageDialog.ShowAsync(); break; } }
//file menu handlers private void NewPrjectFile(object sender, EventArgs e) { NewDialog newdialog = new NewDialog(MOO_APPLICATION_SETTINGS.CurrentProject); if (newdialog.ShowDialog() != DialogResult.OK) { return; } if (newdialog.NewOption == "PROJECT") { Project CreateProject = ProjectFactory.Create(newdialog.ResultObjectFolder, newdialog.ResultObjectName, newdialog.ResultProjectType, newdialog.ResultTemplate); if (CreateProject != null) { MOO_APPLICATION_SETTINGS.CurrentProject = CreateProject; MOO_PROJECT_BROWSER.BuildNodes(CreateProject.Folder, CreateProject.File, CreateProject.Name); } } else { string filename = newdialog.ResultObjectFolder + @"\" + newdialog.ResultObjectName; filename += SupportedFiles.GetExtension(newdialog.ResultObjectType); CodeEditor MCDE = this.CreateEditor(filename, newdialog.ResultObjectType); MCDE.Show(MDockArea); MCDE.DockState = DockState.Document; } }
/// <summary> /// Opens and handles the new file/session dialog. /// </summary> public void InvokeNewDialog() { // TODO: Handle anything that needs to be dealt with before showing the new dialog var newDialog = new NewDialog(); newDialog.ShowDialog(); }
// Menu. private void Menu_New(object sender, EventArgs e) { NewDialog dlg = new NewDialog(); if (dlg.ShowDialog() == DialogResult.OK) { masyuPanel.New(dlg.puzzleWidth, dlg.puzzleHeight); } }
public void InitializeUI() { int topBarHeight = 24; int sideBarWidth = 240; Parameters parameters = Parameters.Filled; TopBar = new TopBar(parent, parent.ScreenWidth / 3, topBarHeight, new Vector2(parent.ScreenWidth / 3, 0), parameters, FillColor); FileMenu fileMenu = new FileMenu(TopBar); TopBar.AddButton(fileMenu); TopBar.AddButton(new EditMenu(TopBar)); parent.objectHandler.InputStateChanged += TopBar.OnInputStateChanged; SideBar leftSideBar = new SideBar(parent, sideBarWidth, parent.ScreenHeight, Vector2.Zero, parameters, FillColor); leftSideBar.AddTool(new TextureCatalog(leftSideBar)); leftSideBar.AddTool(new GridTools(leftSideBar)); SideBar rightSideBar = new SideBar(parent, sideBarWidth, parent.ScreenHeight, new Vector2(parent.ScreenWidth - sideBarWidth, 0), parameters, FillColor); rightSideBar.AddTool(new SpriteScale(rightSideBar)); rightSideBar.AddTool(new SpriteZValue(rightSideBar)); rightSideBar.AddTool(new SpriteColorTint(rightSideBar)); rightSideBar.AddTool(new SpriteRotation(rightSideBar)); rightSideBar.AddTool(new SpriteFlip(rightSideBar)); DialogWindow saveDialog = new SaveDialog(parent); fileMenu.saveButton.ButtonPressed += saveDialog.Show; DialogWindow loadDialog = new LoadDialog(parent); fileMenu.loadButton.ButtonPressed += loadDialog.Show; DialogWindow newProjectDialog = new NewDialog(parent); fileMenu.newProjectButton.ButtonPressed += newProjectDialog.Show; uiObjects.Add(TopBar); uiObjects.Add(leftSideBar); uiObjects.Add(rightSideBar); uiObjects.Add(saveDialog); uiObjects.Add(loadDialog); uiObjects.Add(newProjectDialog); }
private void tsmiLibrary_Click(object sender, EventArgs e) { var form = new NewDialog(DialogType.LIBRARY); if (form.ShowDialog() == DialogResult.OK) { try { Project.AddLibrary(form.name); UpdateProject(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Unable to create new library"); } } }
private void tsmiNewTexture_Click(object sender, EventArgs e) { var form = new NewDialog(DialogType.TEXTURE); if (form.ShowDialog() == DialogResult.OK) { try { string path = Project.AddTexture(form.name, form.type); projectTree.UpdatePath(path); } catch (Exception ex) { MessageBox.Show(ex.Message, "Unable to create new texture"); } } }
private void tsmiNewScript_Click(object sender, EventArgs e) { NewDialog form = new NewDialog(DialogType.SCRIPT, newScriptPattern); if (form.ShowDialog() == DialogResult.OK) { try { string path = Project.AddScript(form.name); projectTree.UpdatePath(path); } catch (Exception ex) { MessageBox.Show(ex.Message, "Unable to add script"); } } }
private void simpleButtonEdit_Click(object sender, EventArgs e) { if (gridViewDialog.RowCount < 1) return; WaitDialog.Show(ParentForm, "Loading components..."); popupDialog = new PopupDialog(); Padding pads = popupDialog.Padding; pads.Left = 5; popupDialog.StartPosition = FormStartPosition.CenterScreen; popupDialog.Text = "Edit Dialog"; GridView view = gridViewDialog; if (view != null || view.SelectedRowsCount > 0) { var ctscd = view.GetRow(view.GetSelectedRows()[0]) as CTSubCampaignDialogs; ucNewDialog1 = new NewDialog(ctscd); ucNewDialog1.ParentController = this; } ucNewDialog1.Dock = DockStyle.Fill; popupDialog.Controls.Add(ucNewDialog1); popupDialog.ClientSize = new Size(1460, 930); popupDialog.FormClosing += new FormClosingEventHandler(popupDialog_FormClosing); WaitDialog.Close(); popupDialog.ShowDialog(this.ParentForm); }
private void simpleButtonAdd_Click(object sender, EventArgs e) { WaitDialog.Show(ParentForm, "Loading components..."); popupDialog = new PopupDialog(); Padding pads = popupDialog.Padding; pads.Left = 5; popupDialog.StartPosition = FormStartPosition.CenterScreen; popupDialog.Text = "Add Dialog"; ucNewDialog1 = new NewDialog(); ucNewDialog1.ParentController = this; ucNewDialog1.Dock = DockStyle.Fill; popupDialog.Controls.Add(ucNewDialog1); popupDialog.ClientSize = new Size(1460, 930); popupDialog.FormClosing += new FormClosingEventHandler(popupDialog_FormClosing); WaitDialog.Close(); popupDialog.ShowDialog(this.ParentForm); }