private void searchTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Enter || SelectedIndex.Equals(-1)) { return; } var newURL = string.Format("{0}\\{1}", Info.GetDirectoryName, GetSelectedItem.Text); if (newURL != Info.URL) { if (File.Exists(newURL)) { OpenFile(newURL); searchTextBox.Text = string.Empty; playlistList.Focus(); } else { MessageBox.Show( GetSelectedItem.Text + " does not exist in this folder! It was either modified or deleted.", "File Error", MessageBoxButtons.OK, MessageBoxIcon.Error); searchTextBox.Focus(); } } }
private void searchTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Enter || SelectedIndex.Equals(-1)) { return; } var newUrl = Path.Combine(mp.FileInfo.GetDirectoryName, GetSelectedItem.Text); if (!newUrl.Equals(mp.FileInfo.Url, StringComparison.OrdinalIgnoreCase)) { if (File.Exists(newUrl)) { OpenFile(newUrl); searchTextBox.Text = string.Empty; playlistList.Focus(); } else { MessageBox.Show( GetSelectedItem.Text + " does not exist in this folder! It was either modified or deleted.", "File Error", MessageBoxButtons.OK, MessageBoxIcon.Error); searchTextBox.Focus(); } } }
internal TActionComponent RequestCurrent() { if (SelectedIndex.Equals(-1)) { return(null); } var model = ItemsSource [SelectedIndex]; var component = TActionComponent.Create(TCategory.Material); component.Models.GadgetMaterialModel.CopyFrom(model); return(component); }