Table of Contents

Class ServerBackupsViewModel

Namespace
McServerLauncher.ViewModels
Assembly
McServerLauncher.dll

Manages world backups for a server: lists existing zip snapshots, and lets the user trigger one manually, restore an earlier one, or delete one. Automatic backups (before every start, after an explicit stop) are triggered by ServerViewModel itself; this view model is just the UI surface over the same WorldBackupService.

public class ServerBackupsViewModel : ObservableObject, INotifyPropertyChanged, INotifyPropertyChanging
Inheritance
ServerBackupsViewModel
Implements
Inherited Members

Constructors

ServerBackupsViewModel(ServerViewModel)

public ServerBackupsViewModel(ServerViewModel server)

Parameters

server ServerViewModel

Properties

BackupNowCommand

Gets an IAsyncRelayCommand instance wrapping McServerLauncher.ViewModels.ServerBackupsViewModel.BackupNow().

[ExcludeFromCodeCoverage]
public IAsyncRelayCommand BackupNowCommand { get; }

Property Value

IAsyncRelayCommand

CanBackupNow

Backups can only be made/restored while the server is stopped: zipping (or replacing) the world folder while the JVM has it open and is actively writing risks a torn/inconsistent snapshot. Both automatic triggers (pre-start, post-stop) already only run while stopped.

public bool CanBackupNow { get; }

Property Value

bool

Config

public ServerConfig Config { get; }

Property Value

ServerConfig

DeleteCommand

[ExcludeFromCodeCoverage]
public IAsyncRelayCommand<BackupItemViewModel?> DeleteCommand { get; }

Property Value

IAsyncRelayCommand<BackupItemViewModel>

IsBusy

[ExcludeFromCodeCoverage]
public bool IsBusy { get; set; }

Property Value

bool

Items

public ObservableCollection<BackupItemViewModel> Items { get; }

Property Value

ObservableCollection<BackupItemViewModel>

RefreshCommand

Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.ServerBackupsViewModel.Refresh().

[ExcludeFromCodeCoverage]
public IRelayCommand RefreshCommand { get; }

Property Value

IRelayCommand

RestoreCommand

[ExcludeFromCodeCoverage]
public IAsyncRelayCommand<BackupItemViewModel?> RestoreCommand { get; }

Property Value

IAsyncRelayCommand<BackupItemViewModel>

StatusText

[ExcludeFromCodeCoverage]
public string StatusText { get; set; }

Property Value

string

Methods

EnsureLoaded()

Loads the backup list the first time the tab is shown.

public void EnsureLoaded()