private void editFeatureBtn_Click(object sender, EventArgs e) { if (!featuresListView.IsAnySelected()) { return; } var item = featuresListView.SelectedItem(); string category = this.category.GetCurrent(); string oldFeature = this.feature.NameOf(item); string oldPath = this.viewData.Provider.GetTexturePathToOpen(category, oldFeature); string newFeature = TextInputDialog.Show("項目名を変更", "", oldFeature); if (newFeature == oldFeature) { return; } this.viewData.Operator.Import(category, newFeature, oldPath); featuresListView.Items.Add(this.listViewItem.Of(category, newFeature)); this.viewData.Operator.RemoveFeature(category, oldFeature); if (!this.viewData.Provider.IsSystemTexture(category, oldFeature)) { featuresListView.Items.Remove(item); } this.listView.RemoveCache(category); this.listView.UpdateFeaturesListView(); }
public static bool GetRenamedLayoutName(string defaultName, Predicate <string> nameValidator, out string layoutName) { Validate.IsNotNull(defaultName, nameof(defaultName)); Validate.IsNotNull(nameValidator, nameof(nameValidator)); return(TextInputDialog.Show(WindowManagement_Resources.RenameLayoutTitle, WindowManagement_Resources.RenameLayoutMessage, 100, defaultName, nameValidator, out layoutName)); }
/* * public void ShowLoadGameMode(UnityAction backButtonDelegate) { * * this.backButtonDelegate = backButtonDelegate; * //editModeManagerCanvas.gameObject.SetActive(true); * loadgameStartWindow.Show( () => * { * TextInputDialog.Show("New layout", (string text) => * { * if (!String.IsNullOrEmpty(text)) * { * string fileName = text + ".json"; * currenteditedFileName = fileName; * startWindow.Hide(); * tablesHolder.Clear(); * } * }); * }, * fileName => { * currenteditedFileName = fileName; * tablesHolder.LoadFromJson(fileName); * startWindow.Hide(); * }, * fileName => { * tablesHolder.LoadFromJson(fileName); * tablesHolder.Apply(); * OnBackButtonPressed(); * } * );Debug.Log("meg kene jelenni"); * } */ public void ShowEditMode(UnityAction backButtonDelegate) { this.backButtonDelegate = backButtonDelegate; editModeManagerCanvas.gameObject.SetActive(true); tableNameText.text = tablesHolder.ActiveTable.tableName; startWindow.Show(() => { TextInputDialog.Show("New layout", (string text) => { if (!String.IsNullOrEmpty(text)) { string fileName = text + ".json"; currenteditedFileName = fileName; startWindow.Hide(); tablesHolder.Clear(); } }); }, fileName => { currenteditedFileName = fileName; tablesHolder.LoadFromJson(fileName); startWindow.Hide(); }, fileName => { tablesHolder.LoadFromJson(fileName); tablesHolder.Apply(); OnBackButtonPressed(); }); }
private void addCategoryBtn_Click(object sender, EventArgs e) { string category = TextInputDialog.Show("新しいカテゴリーの名前: "); categoriesListView.Items.Add(this.listViewItem.Of(category)); this.viewData.Operator.AddCategory(category); this.listView.UpdateCategoriesListView(); }
/// <summary> /// This function is the callback used to execute the command when the menu item is clicked. /// See the constructor to see how the menu item is associated with this function using /// OleMenuCommandService service and MenuCommand class. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event args.</param> private void MenuItemCallback(object sender, EventArgs e) { var dteSolutionHelper = new DteSolutionHelper(); var messageBoxHelper = new MessageBoxHelper(this.ServiceProvider); var selectedProject = dteSolutionHelper.GetSelectedProject(); string newProjectName; bool isOkButtonClicked = TextInputDialog .Show("Full Rename", "Enter new project name", selectedProject.Name, out newProjectName); if (!isOkButtonClicked) { return; } if (newProjectName == selectedProject.Name) { return; } var projectRenamer = new ProjectRenamer() { SolutionFullName = dteSolutionHelper.GetSolutionFullName(), ProjectFullName = selectedProject.FullName, ProjectName = selectedProject.Name, ProjectUniqueName = selectedProject.UniqueName, ProjectNameNew = newProjectName, SolutionProjects = dteSolutionHelper.GetSolutionProjects().Select(it => it.FullName) }; if (IsSharedProject(selectedProject)) { projectRenamer = new SharedTypeProjectRenamer { SolutionFullName = projectRenamer.SolutionFullName, ProjectFullName = selectedProject.FullName, ProjectName = selectedProject.Name, ProjectUniqueName = Path.ChangeExtension(selectedProject.UniqueName, null), ProjectNameNew = newProjectName, SolutionProjects = projectRenamer.SolutionProjects }; } try { projectRenamer.FullRename(); messageBoxHelper.ShowSuccessMessage(); } catch (IOException ioe) { messageBoxHelper.ShowErrorMessage(ioe, "Close all folders, text editors related to the project"); } catch (Exception ex) { messageBoxHelper.ShowErrorMessage(ex); } }
public bool TryGetSavedLayoutName(string defaultName, Predicate <string> nameValidator, out string layoutName) { Validate.IsNotNull(defaultName, nameof(defaultName)); Validate.IsNotNull(nameValidator, nameof(nameValidator)); return(TextInputDialog.Show(WindowManagement_Resources.SaveLayoutCommandDefinitionMessageBox_Title, WindowManagement_Resources.SaveLayoutCommandDefinitionMessageBox_Label, 100, defaultName, nameValidator, out layoutName)); }
public void OnSaveAsButtonPressed() { TextInputDialog.Show("Save layout as", (string text) => { if (!String.IsNullOrEmpty(text)) { string fileName = text + ".json"; tablesHolder.SaveToJson(fileName); currenteditedFileName = fileName; } }); }
public void OnSaveButtonPressed() { TextInputDialog.Show("Save deck layout", (string text) => { if (!String.IsNullOrEmpty(text)) { string fileName = text + ".json"; DeckLayout deckLayoutToSave = currentDeckLayout; deckLayoutToSave.cardNums = cardList.getNumberOfEachCard(); SaveDeckLayoutToFile(fileName, deckLayoutToSave); } }); }
private void addFeatureBtn_Click(object sender, EventArgs e) { string category = this.category.GetCurrent(); if (category == null) { MessageBox.Show("カテゴリーを指定してください。", "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } var result = addFeatureFileDialog.ShowDialog(); if (result != DialogResult.OK) { return; } if (addFeatureFileDialog.FileNames.Length == 1) { string feature = Path.GetFileNameWithoutExtension(addFeatureFileDialog.FileName); feature = TextInputDialog.Show("追加する項目の名前: ", "", feature); this.viewData.Operator.Import(category, feature, addFeatureFileDialog.FileName); featuresListView.Items.Add(this.listViewItem.Of(category, feature)); } else { foreach (var fileName in addFeatureFileDialog.FileNames) { string feature = Path.GetFileNameWithoutExtension(fileName); this.viewData.Operator.Import(category, feature, fileName); featuresListView.Items.Add(this.listViewItem.Of(category, feature)); } } this.listView.RemoveCache(category); this.listView.UpdateFeaturesListView(); }