Exemplo n.º 1
0
 public void OnPostUpdate(
     PostUpdateEvent @event)
 {
     OnPostUpdateAsync(@event, CancellationToken.None).Wait();
 }
 public async Task OnPostUpdateAsync(PostUpdateEvent @event, CancellationToken cancellationToken) =>
 await PostCommitAsync(@event.Entity, cancellationToken);
Exemplo n.º 3
0
 public Task OnPostUpdateAsync(PostUpdateEvent @event, CancellationToken cancellationToken)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 4
0
 public void OnPostUpdate(PostUpdateEvent @event)
 {
     log.Debug(LogMessage);
     assertionDelegate(@event);
 }
Exemplo n.º 5
0
 public static FieldChange CheckChange(int i, PostUpdateEvent ue)
 {
     return(CreateChange(ue.State[i], ue.OldState[i], ue.Persister, i));
 }
Exemplo n.º 6
0
 public void OnPostUpdate(PostUpdateEvent @event)
 {
     //no-op
 }
Exemplo n.º 7
0
 public void OnPostUpdate(PostUpdateEvent @event)
 {
     ProcessCascadingKeyValues(@event);
 }
Exemplo n.º 8
0
 public async Task OnPostUpdateAsync(PostUpdateEvent @event, CancellationToken cancellationToken)
 {
     Console.WriteLine($"Received PostUpdate event for entity {JsonConvert.SerializeObject( @event.Entity, Formatting.None, settings )}");
     await Task.CompletedTask;
 }
Exemplo n.º 9
0
 public void OnPostUpdate(PostUpdateEvent ev)
 {
     DispatchEvents(ev.Entity as AggregateRoot);
 }
Exemplo n.º 10
0
 public void OnPostUpdate(PostUpdateEvent @event)
 {
     EventDispatcher.RaiseEvent(@event.Entity, typeof(UpdatedEvent));
 }
Exemplo n.º 11
0
 public void OnPostUpdate(PostUpdateEvent @event)
 {
     Console.WriteLine($"Received PostUpdate event for entity {JsonConvert.SerializeObject( @event.Entity, Formatting.None, settings )}");
 }
Exemplo n.º 12
0
 public void OnPostUpdate(PostUpdateEvent @event)
 {
     RepositoryFramework.RaisePostUpdate(@event.Entity);
 }
Exemplo n.º 13
0
 public void OnPostUpdate(PostUpdateEvent postevent)
 {
     WriteAudit(postevent.Entity, postevent.OldState, postevent.Persister, postevent.State, postevent.Session, postevent.Id);
 }
Exemplo n.º 14
0
 public virtual void OnPostUpdate(PostUpdateEvent e)
 {
     UpdateInternal(e, e.Entity as T);
 }
Exemplo n.º 15
0
 public void OnPostUpdate(PostUpdateEvent @event)
 {
 }
Exemplo n.º 16
0
 public void OnPostUpdate(PostUpdateEvent e)
 {
     _checker.Update(e.Entity as IEntity);
 }
 /// <inheritdoc />
 public async Task OnPostUpdateAsync(PostUpdateEvent e, CancellationToken cancellationToken) =>
 await Task.Run(() => OnPostUpdate(e), cancellationToken);
Exemplo n.º 18
0
 public async Task OnPostUpdateAsync(PostUpdateEvent @event, CancellationToken cancellationToken)
 {
     await PublishEvents(@event.Entity, cancellationToken);
 }
Exemplo n.º 19
0
 public Task OnPostUpdateAsync(PostUpdateEvent @event, CancellationToken cancellationToken)
 {
     return(Task.Run(() => OnPostUpdate(@event), cancellationToken));
 }
Exemplo n.º 20
0
        public void OnPostUpdate(PostUpdateEvent @event)
        {
            var t = PublishEvents(@event.Entity, CancellationToken.None);

            Task.WaitAll(t);
        }
Exemplo n.º 21
0
        private static void ProcessCascadingKeyValues(PostUpdateEvent @event)
        {
            // Quit if this is not an entity that supports cascading updates
            var cascadableEntity = @event.Entity as IHasCascadableKeyValues;

            if (cascadableEntity == null)
            {
                return;
            }

            // Quit if there are no modified key values to cascade
            var newKeyValues = cascadableEntity.NewKeyValues;

            if (newKeyValues == null)
            {
                return;
            }

            // Make sure the identity has an identifier for performing the update
            var hasIdentifier = @event.Entity as IHasIdentifier;

            if (hasIdentifier == null)
            {
                throw new NotSupportedException(
                          "Cascading updates are only supported for 'aggregate root' entities that implement IHasIdentifier (i.e. entities that have a GUID-based identifier property).");
            }

            string tableName;

            string[] updateTargetColumnNames;
            string[] valueSourceColumnNames;

            // Get the entity's metadata
            var classMetadata = (AbstractEntityPersister)@event.Session.SessionFactory.GetClassMetadata(@event.Entity.GetType());

            // If there is no root table, update using the class' metadata
            if (classMetadata.TableName == classMetadata.RootTableName)
            {
                tableName = classMetadata.TableName;
                updateTargetColumnNames = classMetadata.IdentifierColumnNames;
                valueSourceColumnNames  = classMetadata.IdentifierColumnNames;
            }
            else
            {
                var rootClassMetadata = (AbstractEntityPersister)@event.Session.SessionFactory.GetClassMetadata(classMetadata.RootEntityName);
                tableName = rootClassMetadata.RootTableName;
                updateTargetColumnNames = rootClassMetadata.IdentifierColumnNames;
                valueSourceColumnNames  = classMetadata.IdentifierColumnNames;
            }

            var query = CreateUpdateQuery(
                @event.Session,
                hasIdentifier.Id,
                tableName,
                updateTargetColumnNames,
                valueSourceColumnNames,
                newKeyValues);

            // Execute the update of the primary key
            query.ExecuteUpdate();
        }
Exemplo n.º 22
0
 /// <summary>
 /// Updates the Full-Text index on the entity.
 /// </summary>
 /// <param name="e">
 /// Post update parameters
 /// </param>
 public void OnPostUpdate(PostUpdateEvent e)
 {
     _fullTextModel.UpdateIndexOnEntity(e.Entity);
 }
Exemplo n.º 23
0
 public void OnPostUpdate(PostUpdateEvent @event)
 {
     DispatchEvents(@event.Entity as Entity);
 }
Exemplo n.º 24
0
        public static DetourEvent PostUpdateCallback(StaticContextAccessor accessor)
        {
            var keyboardState = Keyboard.GetState();
            var mouseState    = Mouse.GetState();
            var gamepadState  = GamePad.GetState(PlayerIndex.One);

            /* keyboard events */

            foreach (var key in keyboardState.GetPressedKeys())
            {
                if (!oldKeyboardState.IsKeyDown(key))
                {
                    FireEvent(new KeyPressedEvent(key));
                }
            }

            foreach (var key in oldKeyboardState.GetPressedKeys())
            {
                if (!keyboardState.IsKeyDown(key))
                {
                    FireEvent(new KeyReleasedEvent(key));
                }
            }

            /* probably a way to template this, but whatever, mouse events */

            if (mouseState.LeftButton == ButtonState.Pressed && oldMouseState.LeftButton == ButtonState.Released)
            {
                FireEvent(new MouseButtonPressedEvent(MouseButtonPressedEvent.MouseButton.Left, mouseState));
            }
            if (mouseState.LeftButton == ButtonState.Released && oldMouseState.LeftButton == ButtonState.Pressed)
            {
                FireEvent(new MouseButtonReleasedEvent(MouseButtonReleasedEvent.MouseButton.Left, mouseState));
            }

            if (mouseState.MiddleButton == ButtonState.Pressed && oldMouseState.MiddleButton == ButtonState.Released)
            {
                FireEvent(new MouseButtonPressedEvent(MouseButtonPressedEvent.MouseButton.Middle, mouseState));
            }
            if (mouseState.MiddleButton == ButtonState.Released && oldMouseState.MiddleButton == ButtonState.Pressed)
            {
                FireEvent(new MouseButtonReleasedEvent(MouseButtonReleasedEvent.MouseButton.Middle, mouseState));
            }

            if (mouseState.RightButton == ButtonState.Pressed && oldMouseState.RightButton == ButtonState.Released)
            {
                FireEvent(new MouseButtonPressedEvent(MouseButtonPressedEvent.MouseButton.Right, mouseState));
            }
            if (mouseState.RightButton == ButtonState.Released && oldMouseState.RightButton == ButtonState.Pressed)
            {
                FireEvent(new MouseButtonReleasedEvent(MouseButtonReleasedEvent.MouseButton.Right, mouseState));
            }

            /* gamepad events */

            foreach (Buttons button in Enum.GetValues(typeof(Buttons)))
            {
                if (gamepadState.IsButtonDown(button) && oldGamepadState.IsButtonUp(button))
                {
                    FireEvent(new GamepadButtonPressedEvent(button));
                }
                if (gamepadState.IsButtonUp(button) && oldGamepadState.IsButtonDown(button))
                {
                    FireEvent(new GamepadButtonReleasedEvent(button));
                }
            }


            oldKeyboardState = keyboardState;
            oldMouseState    = mouseState;
            oldGamepadState  = gamepadState;

            var @event = new PostUpdateEvent();

            FireEvent(@event);
            return(@event);
        }
Exemplo n.º 25
0
 public Task OnPostUpdateAsync(PostUpdateEvent @event, CancellationToken cancellationToken)
 {
     return(Task.CompletedTask);
 }
Exemplo n.º 26
0
 public void OnPostUpdateLogEvent(PostUpdateEvent @event)
 {
     PostDatabaseOperationEvent(@event, @event.State, @event.OldState, "UPDATE");
 }
 public void OnPostUpdate(PostUpdateEvent @event) => PostCommit(@event.Entity);
 public void OnPostUpdate(PostUpdateEvent ev)
 {
     DispatchEvents(ev.Entity as Entity);
 }
Exemplo n.º 29
0
 public void OnPostUpdate(PostUpdateEvent @event)
 {
     DispatchEvents(@event.Entity as AggregateRoot);
 }
 public Task OnPostUpdateAsync(PostUpdateEvent ev, CancellationToken cancellationToken) => throw new NotImplementedException();