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
serverServerViewModel
Properties
BackupNowCommand
Gets an IAsyncRelayCommand instance wrapping McServerLauncher.ViewModels.ServerBackupsViewModel.BackupNow().
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand BackupNowCommand { get; }
Property Value
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
Config
public ServerConfig Config { get; }
Property Value
DeleteCommand
Gets an IAsyncRelayCommand<T> instance wrapping Delete(BackupItemViewModel).
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand<BackupItemViewModel?> DeleteCommand { get; }
Property Value
IsBusy
[ExcludeFromCodeCoverage]
public bool IsBusy { get; set; }
Property Value
Items
public ObservableCollection<BackupItemViewModel> Items { get; }
Property Value
RefreshCommand
Gets an IRelayCommand instance wrapping McServerLauncher.ViewModels.ServerBackupsViewModel.Refresh().
[ExcludeFromCodeCoverage]
public IRelayCommand RefreshCommand { get; }
Property Value
RestoreCommand
Gets an IAsyncRelayCommand<T> instance wrapping Restore(BackupItemViewModel).
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand<BackupItemViewModel?> RestoreCommand { get; }
Property Value
StatusText
[ExcludeFromCodeCoverage]
public string StatusText { get; set; }
Property Value
Methods
EnsureLoaded()
Loads the backup list the first time the tab is shown.
public void EnsureLoaded()