예제 #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);
        }
예제 #5
0
        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);
        }
예제 #9
0
 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);
 }