public async Task UnloadAsync(string id, object asset, IAssetUnloadParameters parameters) { if (string.IsNullOrEmpty(id)) { throw new ArgumentException("Value cannot be null or empty.", nameof(id)); } if (asset == null) { throw new ArgumentNullException(nameof(asset)); } if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } Type type = asset.GetType(); Unloading?.Invoke(id, asset, parameters); await OnUnloadAsync(id, asset, parameters); Unloaded?.Invoke(id, type, parameters); }
public async Task UnloadAsync(string id, Scene scene, ISceneUnloadParameters parameters) { if (string.IsNullOrEmpty(id)) { throw new ArgumentException("Value cannot be null or empty.", nameof(id)); } if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } LogSceneUnload(id, scene, parameters, true); Unloading?.Invoke(id, scene, parameters); OnRemoveScene(id, scene, parameters); await OnUnloadAsync(id, scene, parameters); Instances.Remove(scene); Unloaded?.Invoke(id, parameters); LogSceneUnloaded(id, parameters, true); }
protected virtual void OnUnloading(EventArgs e) { Unloading?.Invoke(this, e); }
public virtual void OnUnloading(EventArgs e) { Unloading?.Invoke(this, e); }
/// <summary> /// Called when the tab page's content is unloading. /// </summary> public virtual void Unload() { Unloading?.Invoke(this, EventArgs.Empty); }
public void Unload() { Unloading?.Invoke(null, new EventArgs()); }