private void AddNewShellItem(string scenePath) { string shellPath = GetShellPath(scenePath); using (NewShellDialog dlg = new NewShellDialog()) { dlg.ScenePath = scenePath; dlg.ShellPath = shellPath; if (dlg.ShowDialog() != DialogResult.OK) { return; } for (int i = 0; i < this.Controls.Count; i++) { if (this.Controls[i] is NewItem) { ShellItem item; if (Scene != Scenes.CommandStore) { item = new ShellItem(dlg.NewItemRegPath); } else { item = new StoreShellItem(dlg.NewItemRegPath, true, false); } this.InsertItem(item, i + 1); break; } } } }
private void AddNewItem() { if (!CanAddMore()) { return; } using (NewShellDialog dlg = new NewShellDialog { ScenePath = this.ScenePath, ShellPath = this.ShellPath }) { if (dlg.ShowDialog() == DialogResult.OK) { this.InsertItem(new SubShellItem(dlg.NewItemRegPath), GetItemIndex(newItem) + 1); } } }
private void AddNewItem() { if (!SubShellTypeItem.CanAddMore(this)) { return; } using (NewShellDialog dlg = new NewShellDialog { ScenePath = this.ScenePath, ShellPath = this.ShellPath }) { if (dlg.ShowDialog() != DialogResult.OK) { return; } this.AddItem(new SubShellItem(this, dlg.NewItemRegPath)); } }
private void AddNewItem() { if (!SubShellTypeItem.CanAddMore(this)) { return; } using (NewShellDialog dlg = new NewShellDialog()) { dlg.ScenePath = this.ScenePath; dlg.ShellPath = ShellItem.CommandStorePath; if (dlg.ShowDialog() != DialogResult.OK) { return; } SubKeyNames.Add(dlg.NewItemKeyName); SaveSorting(); this.AddItem(new SubShellItem(this, dlg.NewItemKeyName)); } }
private void AddNewShellItem(string scenePath) { string shellPath = GetShellPath(scenePath); using (NewShellDialog dlg = new NewShellDialog()) { dlg.ScenePath = scenePath; dlg.ShellPath = shellPath; if (dlg.ShowDialog() != DialogResult.OK) { return; } for (int i = 0; i < this.Controls.Count; i++) { if (this.Controls[i] is NewItem) { this.InsertItem(new ShellItem(dlg.NewItemRegPath), i + 1); break; } } } }
private void AddNewItem() { if (!CanAddMore()) { return; } using (NewShellDialog dlg = new NewShellDialog { ScenePath = this.ScenePath, ShellPath = ShellItem.CommandStorePath }) { if (dlg.ShowDialog() != DialogResult.OK) { return; } SubKeyNames.Add(dlg.NewItemKeyName); WriteRegistry(); SubShellItem item = new SubShellItem(this, dlg.NewItemKeyName); this.AddItem(item); this.HoveredItem = item; } }