示例#1
0
 private void OnDisable()
 {
     foreach (IManagedObject managedObject in GetComponents <IManagedObject>())
     {
         Unregistered?.Invoke(managedObject);
     }
 }
示例#2
0
        private void Remove(T instance)
        {
            if (!_space.Remove(instance))
            {
                return;
            }

            _newInstances.Remove(instance);
            Unregistered?.Invoke(instance);
        }
示例#3
0
        /// <summary>
        /// Unregisters an element with the name scope.
        /// </summary>
        /// <param name="name">The name.</param>
        public void Unregister(string name)
        {
            Contract.Requires <ArgumentNullException>(name != null);

            object element;

            if (_inner.TryGetValue(name, out element))
            {
                _inner.Remove(name);
                Unregistered?.Invoke(this, new NameScopeEventArgs(name, element));
            }
        }
示例#4
0
        private void Interpret(IDecompositionMessage <T> message)
        {
            T instance = message.Instance;

            if (!_tracker.Remove(instance))
            {
                return;
            }

            _newInstances.Remove(instance);
            Unregistered?.Invoke(instance);
        }
        public void Unregister(Item item)
        {
            if (!IsRegistered(item))
            {
                this.Log($"Cannot unregister {item}: Item is not registered");
                return;
            }

            this.Log($"Unregistering {item}");

            Slots.Remove(GetSlot(item));
            Unregistered?.Invoke(this, new RegisteredEventArgs(item));
        }
        public void Unregister(EntityComponent entity)
        {
            if (!entity)
            {
                return;
            }

            this.Log($"Registry unregistering entity {entity}");

            Entities.Remove(entity);

            Unregistered?.Invoke(this, new EntityEventArgs(entity));
        }
示例#7
0
        public void Unregister(ICallout callout)
        {
            Argument.IsNotNull(() => callout);

            Log.Debug($"Unregistering callout '{callout}'");

            UnsubscribeFromCallout(callout);

            // Make sure to hide
            callout.Hide();

            _callouts.Remove(callout);

            Unregistered?.Invoke(this, new CalloutEventArgs(callout));
        }
示例#8
0
        /// <inheritdoc />
        /// <summary>
        ///     Unregisters the specified character spawn.
        /// </summary>
        /// <param name="characterSpawn">The character spawn.</param>
        public void Unregister(ICharacterSpawn characterSpawn)
        {
            if (!Members.ContainsKey(characterSpawn.Id))
            {
                return;
            }

            ChannelUnregisteringEventArgs channelUnregisteringEventArgs = new ChannelUnregisteringEventArgs(characterSpawn);

            Unregistering?.Invoke(this, channelUnregisteringEventArgs);
            if (channelUnregisteringEventArgs.Cancel)
            {
                return;
            }

            Members.Remove(characterSpawn.Id);

            ChannelUnregisteredEventArgs channelUnregisteredEventArgs = new ChannelUnregisteredEventArgs(characterSpawn);

            Unregistered?.Invoke(this, channelUnregisteredEventArgs);
        }
 private void OnUnregistered(Type e)
 {
     Unregistered?.Invoke(this, e);
 }
        ///<summary>Fires the Unregistered event.</summary>
        public override void HandleBasicCancelOk(string consumerTag)
        {
            base.HandleBasicCancelOk(consumerTag);

            Unregistered?.Invoke(this, new ConsumerEventArgs(consumerTag));
        }
 protected virtual void OnUnregistered(PrinterEventArgs e)
 {
     Unregistered?.Invoke(this, e);
 }
示例#12
0
        ///<summary>Fires the Unregistered event.</summary>
        public override async Task HandleBasicCancelOk(string consumerTag)
        {
            await base.HandleBasicCancelOk(consumerTag).ConfigureAwait(false);

            await(Unregistered?.Invoke(this, new ConsumerEventArgs(new[] { consumerTag })) ?? Task.CompletedTask).ConfigureAwait(false);
        }
示例#13
0
 /// <summary>
 ///     Raises the <see cref="Unregistered"/> event.
 /// </summary>
 /// <param name="e">An <see cref="EventArgs"/> that contains the event data.</param>
 public void OnUnregistered(EventArgs e)
 {
     Unregistered?.Invoke(this, e);
 }