private void ShortcutAdd(IView v) { VideoViewTag tag = new VideoViewTag(v.ID, v.Title); foreach (VideoViewTag t in this.toolStripComboBoxShortCut.Items) { if (t.ID.Equals(tag.ID)) { return; } } this.toolStripComboBoxShortCut.Items.Add(tag); this.ViewCount++; try { object o = this.toolStripComboBoxShortCut.SelectedItem; ArrayList list = ArrayList.Adapter(this.toolStripComboBoxShortCut.Items); list.Sort(); this.toolStripComboBoxShortCut.SelectedItem = o; } catch (Exception e) { MessageBox.Show(e.Message, MotionPreference.Instance.MessageBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void toolStripComboBoxShortCut_SelectedIndexChanged(object sender, EventArgs e) { VideoViewTag tag = (VideoViewTag)this.toolStripComboBoxShortCut.SelectedItem; if (tag != null) { this.ScrollToView(tag.ID); } }