public void SaveAsFile() { if (Loading.FilePath != null) { SaveSTBLXMLDialog.InitialDirectory = Path.GetDirectoryName(Loading.FilePath); SaveSTBLXMLDialog.FileName = Path.GetFileName(Loading.FilePath); } if (SaveSTBLXMLDialog.ShowDialog() == DialogResult.Cancel) { return; } string saveFilePath = SaveSTBLXMLDialog.FileName; SaveSTBLXMLDialog.InitialDirectory = ""; SaveSTBLXMLDialog.FileName = ""; try { Loading.SaveFile(saveFilePath); } catch (Exception saveException) { ShowSaveFailureDialog(saveException); } EntryBrowser.RefreshItems(); }
private void MenuStripFileMergeItem_Click(object sender, EventArgs e) { MergeWith mergeForm = new MergeWith(); mergeForm.ShowDialog(); EntryBrowser.SetupRows(); }
public void ImportFromPackageFile() { Import importDialog = new Import(); importDialog.ShowDialog(); EntryBrowser.SetupRows(); }
private void FilterActiveCheckBox_CheckedChanged(object sender, EventArgs e) { if (FilterActiveCheckBox.Checked) { if (CurrentBrowserFilter != null) { EntryBrowser.FilterItems(CurrentBrowserFilter.GetFilterPredicate()); } } else { EntryBrowser.UnfilterAll(); } }
private void FilterAdvancedButton_Click(object sender, EventArgs e) { SelectorFilterOptions filterOptionsForm = new SelectorFilterOptions(); filterOptionsForm.ShowDialog(); if (filterOptionsForm.GeneratedFilter != null) { CurrentBrowserFilter = filterOptionsForm.GeneratedFilter; if (FilterActiveCheckBox.Checked) { EntryBrowser.FilterItems(CurrentBrowserFilter.GetFilterPredicate()); } } }
private void AddEntryButton_Click(object sender, EventArgs e) { SelectorNew selectorNewForm = new SelectorNew(); selectorNewForm.ShowDialog(); STBLXMLEntry createdEntry = selectorNewForm.CreatedEntry; if (createdEntry == null) { return; } EntryBrowser.SetupRows(); EntryBrowser.ScrollToItem(createdEntry, selectItem: true); }
private void MenuStripEditSelectedResetKeysItem_Click(object sender, EventArgs e) { foreach (DataGridViewRow selectedEntryRow in EntryBrowser.GetAllSelectedItems()) { STBLXMLEntry entry = EntryBrowser.FindEntry(selectedEntryRow); if (entry != null) { continue; } entry.Key = STBL.GetRandomUIntKey(blockedKeys: Loading.GetAllEntryKeys()); } EntryBrowser.RefreshItems(); }
public Selector() { InitializeComponent(); EntryBrowser.SetupRows(); UpdateStatusBarItemsLabel(); UpdateStatusBarSelectedLabel(); Loading.FileChanged += Loading_Changed; Loading.BecameClean += Loading_Changed; Loading.BecameDirty += Loading_Changed; EntryBrowser.ItemCountUpdate += EntryBrowser_ItemCountUpdate; EntryBrowser.SelectedCountUpdate += EntryBrowser_SelectedCountUpdate; }
public bool OpenFile() { if (Loading.IsDirty) { DialogResult unsavedDialogResult = ShowUnsavedDialog(); if (unsavedDialogResult == DialogResult.Yes) { SaveFile(); } else if (unsavedDialogResult == DialogResult.Cancel) { return(false); } } if (Loading.FilePath != null) { OpenSTBLXMLDialog.InitialDirectory = Path.GetDirectoryName(Loading.FilePath); } if (OpenSTBLXMLDialog.ShowDialog() == DialogResult.Cancel) { return(false); } string openFilePath = OpenSTBLXMLDialog.FileName; OpenSTBLXMLDialog.InitialDirectory = ""; OpenSTBLXMLDialog.FileName = ""; try { Loading.OpenFile(openFilePath); } catch (Exception openException) { ShowOpenFailureDialog(openException); } EntryBrowser.SetupRows(); return(true); }
public bool NewFile() { if (Loading.IsDirty) { DialogResult unsavedDialogResult = ShowUnsavedDialog(); if (unsavedDialogResult == DialogResult.Yes) { SaveFile(); } else if (unsavedDialogResult == DialogResult.Cancel) { return(false); } } Loading.NewFile(); EntryBrowser.SetupRows(); return(true); }
public void UpdateStatusBarSelectedLabel() { FormStatusStripSelectedCount.Text = string.Format(Localization.GetString(statusBarSelectedTextIdentifier), EntryBrowser.GetSelectedItemCount()); }
public void UpdateStatusBarItemsLabel() { FormStatusStripItemsCount.Text = string.Format(Localization.GetString(statusBarItemsTextIdentifier), EntryBrowser.GetItemCount()); }
private void MenuStripEditSelectedRemoveAllItem_Click(object sender, EventArgs e) { EntryBrowser.RemoveSelectedItems(); }
private void MenuStripEditDeselectAllItem_Click(object sender, EventArgs e) { EntryBrowser.DeselectAllItems(); }