MediaEditor/MainWindow.xaml.cs
/// <summary>
/// Delete key down event for deleting the selected files in the media list
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
Delete key down event for deleting the selected files in the media list
Delete key down event for deleting the selected files in the media list
private void DeleteKeyPressed_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            try
            {
                List<object> tempList = new List<object>();
                foreach (var item in FileList.SelectedItems)
                {
                    tempList.Add(item);
                }
                foreach (var item in tempList)
                {
                    if (e.Key == System.Windows.Input.Key.Delete)
                    {
                        FileList.Items.Remove(item);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
private void DeleteKeyPressed_KeyDown ( object sender , System . Windows . Input . KeyEventArgs e ) { try { List < object > tempList = new List < object > ( ) ; foreach ( var item in FileList . SelectedItems ) { tempList . Add ( item ) ; } foreach ( var item in tempList ) { if ( e . Key == System . Windows . Input . Key . Delete ) { FileList . Items . Remove ( item ) ; } } } catch ( Exception ) { throw ; } }
Delete key down event for deleting the selected files in the media list
Delete key down event for deleting the selected files in the media list
// Create a temporary list for adding selected items. // Directly delete selected items cause a crash. (Static) // Control if "DEL" key down
sender
object
None
e
System.Windows.Input.KeyEventArgs
None