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

            _newInstances.Remove(instance);
            Unregistered?.Invoke(instance);
        }
Esempio n. 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));
            }
        }
Esempio n. 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));
        }
 public HttpResponseMessage GetUn(string EventId, string employeeId)
 {
     try
     {
         Unregistered unregistered = new Unregistered();
         UnRegisteredVolunteerFeedbackDTO unRegisteredVolunteerFeedbackDTO = unregistered.GetUnregisterVolunteerFeedback(EventId, employeeId);
         return(Request.CreateResponse(HttpStatusCode.OK, unRegisteredVolunteerFeedbackDTO));
     }
     catch (Exception)
     {
         throw new HttpResponseException(HttpStatusCode.InternalServerError);
     }
 }
 public HttpResponseMessage PostUn(UnRegisteredVolunteerFeedbackDTO unRegisteredVolunteerFeedbackDTO)
 {
     try
     {
         Unregistered unregistered = new Unregistered();
         unregistered.SaveUnregisterVolunteerFeedback(unRegisteredVolunteerFeedbackDTO);
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     catch (Exception)
     {
         throw new HttpResponseException(HttpStatusCode.InternalServerError);
     }
 }
Esempio n. 9
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));
        }
Esempio n. 10
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);
        }
Esempio n. 11
0
        public static async Task UnregisteredType_NotModified(Guid id, JsonSerializerSettings serializerSettings)
        {
            var dto = new Unregistered
            {
                Id = id,
            };

            using var svc = new ServiceContainer();
            var repo = new HalRepository(ImmutableDictionary <Type, ITransformationInstructions> .Empty, svc);
            var sut  = new HalJsonOutputFormatter(serializerSettings, ArrayPool <char> .Shared, new MvcOptions(), repo);

            await using var writer = new StringWriter();
            var context = new OutputFormatterWriteContext(
                new DefaultHttpContext(),
                (_, _) => writer,
                typeof(Unregistered),
                dto);

            await sut.WriteResponseBodyAsync(context, new UTF8Encoding(encoderShouldEmitUTF8Identifier : false)).ConfigureAwait(false);

            var actual = JsonConvert.DeserializeObject <Unregistered>(writer.ToString(), serializerSettings);

            Assert.Equal(id, actual.Id);
        }
Esempio n. 12
0
        ///<summary>Fires when the server confirms successful consumer cancelation.</summary>
        public override async Task HandleBasicCancelOk(string consumerTag)
        {
            await base.HandleBasicCancelOk(consumerTag).ConfigureAwait(false);

            await Unregistered.InvokeAsync(this, new ConsumerEventArgs(new[] { consumerTag })).ConfigureAwait(false);
        }
Esempio n. 13
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);
 }
Esempio n. 16
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);
 }