46 this.IsLoading =
true;
49 CancellationToken.ThrowIfCancellationRequested();
61 this.IsLoaded = isLoaded;
62 this.IsLoading =
false;
83 this.IsUnloading =
true;
94 this.IsLoaded =
false;
95 this.IsUnloading =
false;
103 public virtual Task
Load(
bool isResuming, CancellationToken cancellationToken)
105 return Task.CompletedTask;
111 return Task.CompletedTask;
114 private event EventHandler<LoadedEventArgs>? PrivLoaded;
117 public event EventHandler<LoadedEventArgs>
Loaded
130 private void OnLoaded(LoadedEventArgs e)
132 PrivLoaded.Raise(
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...