44 this.IsLoading =
true;
47 CancellationToken.ThrowIfCancellationRequested();
59 this.IsLoaded = isLoaded;
60 this.IsLoading =
false;
81 this.IsUnloading =
true;
92 this.IsLoaded =
false;
93 this.IsUnloading =
false;
101 public virtual Task
Load(
bool isResuming, CancellationToken cancellationToken)
103 return Task.CompletedTask;
109 return Task.CompletedTask;
112 private event EventHandler<LoadedEventArgs>? PrivLoaded;
115 public event EventHandler<LoadedEventArgs>
Loaded
128 private void OnLoaded(LoadedEventArgs e)
130 PrivLoaded?.Invoke(
this, e);
bool IsUnloading
Gets whether the service is being unloaded.
bool BeginLoad(bool IsResuming, CancellationToken CancellationToken)
Sets the IsLoading flag if the service isn't already loading.
virtual Task Unload()
Unloads the specified service.
bool IsLoading
Gets whether the service is being loaded.
void EndLoad(bool isLoaded)
Sets the IsLoading and IsLoaded flags and fires an event representing the current load state of the s...
virtual Task Load(bool isResuming, CancellationToken cancellationToken)
Loads the specified service.
bool IsResuming
If App is resuming service.
bool BeginUnload()
Sets the IsLoading flag if the service isn't already unloading.
void EndUnload()
Sets the IsLoading and IsLoaded flags and fires an event representing the current load state of the s...
bool IsLoaded
Gets whether the service is loaded.
EventHandler< LoadedEventArgs > Loaded
Fires whenever the loading state of the service changes.
A service that can be loaded and unloaded at will. Typically during startup and shutdown of an applic...