Beispiel #1
0
 protected PropertyEventArgs(OGMImpl sender, Property property, OperationEnum operation, object?previousValue, object?assignedValue) : base(sender)
 {
     Property  = property;
     Operation = operation;
     PreviousValueInternalBridge = previousValue;
     AssignedValueInternalBridge = assignedValue;
 }
Beispiel #2
0
        protected EntityEventArgs(OGMImpl sender)
        {
            Entity      = sender?.GetEntity() !;
            Transaction = sender?.DbTransaction !;

            Canceled = false;
            Flushed  = false;
        }
Beispiel #3
0
        internal static EntityEventArgs CreateInstance(EventTypeEnum eventType, OGMImpl sender, Transaction trans, bool locked = false)
        {
            Type type = sender.GetEntity().EntityEventArgsType;

            EntityEventArgs args = (EntityEventArgs)Activator.CreateInstance(type, true) !;

            args.EventType            = eventType;
            args.SenderInternalBridge = sender;
            args.Entity      = sender.GetEntity();
            args.Transaction = trans;
            args.Locked      = locked;

            sender.AppendEventHistory(args);

            return(args);
        }
Beispiel #4
0
        internal static PropertyEventArgs CreateInstance(EventTypeEnum eventType, OGMImpl sender, Property property, object?previousValue, object?assignedValue, DateTime moment, OperationEnum operation, Transaction trans)
        {
            Type senderType = sender.GetType();
            Type argsType   = property.GetPropertyEventArgsType(senderType);

            PropertyEventArgs args = (PropertyEventArgs)Activator.CreateInstance(argsType, true) !;

            args.EventType            = eventType;
            args.SenderInternalBridge = sender;
            args.Entity    = sender.GetEntity();
            args.Property  = property;
            args.Operation = operation;
            args.PreviousValueInternalBridge = previousValue;
            args.AssignedValueInternalBridge = assignedValue;
            args.Moment      = moment;
            args.Transaction = trans;

            sender.AppendEventHistory(args);

            return(args);
        }