src/TF2HUD.Editor/MainWindow.xaml.cs
/// <summary>
///     Invoke HUD deletion from the tf/custom directory.
/// </summary>
Invoke HUD deletion from the tf/custom directory.
Invoke HUD deletion from the tf / custom directory .
private void BtnUninstall_OnClick(object sender, RoutedEventArgs args)
        {
            try
            {
                if (!CheckHudInstallation()) return;
                if (Utilities.IsGameRunning())
                {
                    _notifier.ShowMessageBox(MessageBoxImage.Warning, Utilities.GetLocalizedString(Properties.Resources.info_game_running));
                    return;
                }
                Logger.Info($"Start uninstalling {HudSelection}.");
                Logger.Info($"Removing {HudSelection} from: {HudPath}");
                Directory.Delete(HudPath + $"\\{HudSelection}", true);
                Json.OnPropertyChanged("HighlightedHUD");
                Json.OnPropertyChanged("HighlightedHUDInstalled");
            }
            catch (Exception e)
            {
                _notifier.ShowMessageBox(MessageBoxImage.Error, $"{string.Format(Utilities.GetLocalizedString(Properties.Resources.error_hud_uninstall), HudSelection)} {e.Message}");
            }
        }
private void BtnUninstall_OnClick ( object sender , RoutedEventArgs args ) { try { if ( ! CheckHudInstallation ( ) ) return ; if ( Utilities . IsGameRunning ( ) ) { _notifier . ShowMessageBox ( MessageBoxImage . Warning , Utilities . GetLocalizedString ( Properties . Resources . info_game_running ) ) ; return ; } Logger . Info ( $" Start uninstalling  { HudSelection } . " ) ; Logger . Info ( $" Removing  { HudSelection }  from:  { HudPath } " ) ; Directory . Delete ( HudPath + $" \\ { HudSelection } " , true ) ; Json . OnPropertyChanged ( " " ) ; Json . OnPropertyChanged ( " " ) ; } catch ( Exception e ) { _notifier . ShowMessageBox ( MessageBoxImage . Error , $" { string . Format ( Utilities . GetLocalizedString ( Properties . Resources . error_hud_uninstall ) , HudSelection ) } { e . Message } " ) ; } }
Invoke HUD deletion from the tf/custom directory.
Invoke HUD deletion from the tf / custom directory .
// Check if the HUD is installed in a valid directory. // Stop the process if Team Fortress 2 is still running. // Remove the HUD from the tf/custom directory.
sender
object
args
RoutedEventArgs