Ejemplo n.º 1
0
        internal void InvokeAsync(DatabaseActionHandler handler, object sender, IDbCommand query)
        {
            if (!RaiseEvents)
            {
                return;
            }

            if (handler != null)
            {
                if (Async && !ThreadSave && RaiseEventsAsync)
                {
                    var eventListeners = handler.GetInvocationList();
                    foreach (var t in eventListeners)
                    {
                        var methodToInvoke      = (DatabaseActionHandler)t;
                        var databaseActionEvent = new DatabaseActionEvent(query.CreateQueryDebugger(Database));
                        methodToInvoke.BeginInvoke(sender, databaseActionEvent, ar =>
                        {
                            OnHandlerRaised(databaseActionEvent, handler);
                        }, null);
                    }
                }
                else
                {
                    var eventArgs = new DatabaseActionEvent(query.CreateQueryDebugger(Database));
                    handler(sender, eventArgs);
                    OnHandlerRaised(eventArgs, handler);
                }
            }
        }
Ejemplo n.º 2
0
        internal void OnHandlerRaised(DatabaseActionEvent e, DatabaseActionHandler eventhandler)
        {
            var handler = HandlerRaised;

            if (handler != null)
            {
                handler(this, e, eventhandler);
            }
        }
Ejemplo n.º 3
0
        internal void OnHandlerRaised(DatabaseActionEvent e, DatabaseActionHandler eventhandler)
        {
            var handler = HandlerRaised;

            handler?.Invoke(this, e, eventhandler);
        }