示例#1
0
        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);
        }
示例#3
0
 protected virtual void OnUnloading(EventArgs e)
 {
     Unloading?.Invoke(this, e);
 }
 public virtual void OnUnloading(EventArgs e)
 {
     Unloading?.Invoke(this, e);
 }
示例#5
0
 /// <summary>
 /// Called when the tab page's content is unloading.
 /// </summary>
 public virtual void Unload()
 {
     Unloading?.Invoke(this, EventArgs.Empty);
 }
示例#6
0
 public void Unload()
 {
     Unloading?.Invoke(null, new EventArgs());
 }