Ejemplo n.º 1
0
 protected void OnDriveRemoved(DriveEventArgs e)
 {
     if (DriveRemoved != null)
     {
         DriveRemoved(this, e);
     }
 }
Ejemplo n.º 2
0
        public void OnDriveSelected(DriveEventArgs e)
        {
            var handler = DriveSelected;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Обновляет коллекцию табов в соответстивии с Drive Scaner
        /// </summary>
        /// <param name="sender">DriveEventArgs</param>
        /// <param name="e">DriveScaner - не используется</param>
        private void DriveChanged(object sender, DriveEventArgs e)
        {
            switch (e.Action)
            {
            case DeviceAction.AddDevice:
                Dispatcher.Invoke(new Action(() => AddDevice(e.DriveName)), null);
                break;

            case DeviceAction.RemoveDevice:
                Dispatcher.Invoke(new Action(() => RemoveDevice(e.ListPosition)), null);
                break;
            }
        }
 /// <summary>
 /// Event on TabItem clicked - it open root;
 /// </summary>
 /// <param name="sender">TabItem</param>
 /// <param name="e">RoutedEventArgs</param>
 private void DriveTabDriveSelected(object sender, DriveEventArgs e)
 {
     if (_fileSystem.DirectoryExists(e.DriveName))
     {
         CurrentPath = e.DriveName;
     }
     else
     if (Windows.Dialogs.MessageBox.ShowDialog(
             String.Format(
                 "Диск {0,3} не найден.\n\nПерейти на системный диск {1} ?",
                 CurrentDrive,
                 Environment.SystemDirectory.Substring(0, 3)
                 ),
             "Ultimate Commander - Подсистема доступа",
             MessageBoxButton.YesNo) == true)
     {
         CurrentPath  = Environment.SystemDirectory.Substring(0, 3);
         CurrentDrive = CurrentPath;
     }
 }