예제 #1
0
        public void Invoke()
        {
            command.Invoke(parameters);
            lastStart = DateTime.Now;

            Invoked?.Invoke(this, EventArgs.Empty);
        }
예제 #2
0
 void TrayIcon_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Left)
     {
         Invoked.Invoke();
     }
 }
예제 #3
0
        /// <summary>
        /// Wywołuje wykonanie akcji
        /// </summary>
        /// <param name="requestData">Dane wejściowe</param>
        /// <returns>Odpowiedź od akcji</returns>
        public JObject Invoke(ClientConnection conn, JObject requestData)
        {
            BaseSerializer requestSerializer = (BaseSerializer)Activator.CreateInstance(RequestSerializerType);

            requestSerializer.SetData(requestData);
            requestSerializer.Validate();

            // Wywołanie wydarzenia
            var argsInvk = new ActionInvokeEventArgs()
            {
                RequestData = requestSerializer
            };

            InvokedThis?.Invoke(this, argsInvk);
            Invoked?.Invoke(this, argsInvk);

            // Główna metoda wykonująca akcję
            BaseSerializer responseSerializer = PerformAction(conn, requestSerializer);

            // Wywołanie wydarzenia
            var argsFnshd = new ActionFinishEventArgs()
            {
                RequestData  = requestSerializer,
                ResponseData = responseSerializer
            };

            FinishedThis?.Invoke(this, argsFnshd);
            Finished?.Invoke(this, argsFnshd);

            // Zwrócenie odpowiedzi
            return(responseSerializer.GetApiObject());
        }
        private bool OnInvoked()
        {
            var args = new GooeyButtonInvokedEventArgs();

            Invoked.Invoke(this, args);
            return(args.Cancel);
        }
예제 #5
0
 public void Invoke(Gwen.Control.ControlBase sender, IDictionary parameters)
 {
     Invoked?.Invoke(sender, new LuaEventArgs()
     {
         Parameters = parameters
     });
 }
 private void IgnoreFocusKeyboardAccelerator_Invoked(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs e)
 {
     if (FocusManager.GetFocusedElement().GetType() != typeof(TextBox))
     {
         Invoked?.Invoke(sender, e);
     }
 }
예제 #7
0
        public virtual CfrV8Value Invoke(CfrV8HandlerExecuteEventArgs args, JsBinding binding, HtmlTextureWrapper wrapper)
        {
            var res = Function(args, binding, wrapper);

            Invoked?.Invoke(this, wrapper);
            InvokeCount++;
            return(res);
        }
예제 #8
0
        private void OnTick(object sender, object e)
        {
            _timer.Stop();

            Invoked?.Invoke(_lastSender, _lastArgs);

            _lastSender = null;
            _lastArgs   = default;
        }
예제 #9
0
        public void OnInvoked()
        {
            if (Command != null && Command.CanExecute(CommandParameter))
            {
                Command.Execute(CommandParameter);
            }

            Invoked?.Invoke(this, EventArgs.Empty);
        }
예제 #10
0
        void Maui.ISwipeItem.OnInvoked()
        {
            if (Command != null && Command.CanExecute(CommandParameter))
            {
                Command.Execute(CommandParameter);
            }

            OnClicked();
            Invoked?.Invoke(this, EventArgs.Empty);
        }
예제 #11
0
 public static void OnInvoked(ApiInvokedArgs args)
 {
     try
     {
         Invoked?.Invoke(null, args);
     }
     catch (Exception ex)
     {
         throw new ApiInvocationException("Handling Api Invoked event failed.", ex);
     }
 }
예제 #12
0
        public Task <bool> Invoke(string code = "", string install = "")
        {
            var args = new OAuthAcceptanceEventArgs()
            {
                Code    = code,
                Install = install
            };

            Invoked?.Invoke(this, args);


            return(Task.FromResult(true));
        }
예제 #13
0
            public Task Invoke(CustomFilter2Attribute attribute, VMContext context, NextFilterDelegate next)
            {
                if (context.HubContext.CallType == "Response_VM")
                {
                    var data = JsonConvert.DeserializeObject <IDictionary <string, object> >(context.HubContext.Data.ToString());
                    foreach (var key in data.Keys.ToList())
                    {
                        data[key] = data[key].ToString().ToUpper();
                    }
                    context.HubContext.Data = JsonConvert.SerializeObject(data);
                }

                Invoked?.Invoke(this, Tuple.Create(attribute, context));
                return(next.Invoke(context));
            }
예제 #14
0
 void TrayIcon_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Left)
     {
         Invoked.Invoke();
     }
     else if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         var cm = BuildContextMenu(true);
         cm.Placement = PlacementMode.Mouse;
         cm.IsOpen    = true;
     }
     else if (e.Button == System.Windows.Forms.MouseButtons.Middle)
     {
     }
 }
예제 #15
0
        public override void Handle(HandleContext context)
        {
            var packet  = context.Packet;
            var session = context.Session;

            var response = packet as IResponse;

            if (response != null)
            {
                Console.WriteLine("调用回复");

                Invoked?.Invoke(response);
            }

            var e = packet as EventInfo;

            if (e != null)
            {
                Console.WriteLine("事件");

                Raised?.Invoke(e);
            }
        }
예제 #16
0
 public Task Invoke(CustomFilter1Attribute attribute, VMContext context, NextFilterDelegate next)
 {
     Invoked?.Invoke(this, Tuple.Create(attribute, context));
     return(next.Invoke(context));
 }
예제 #17
0
 /// <summary>Метод первичной генерации события <see cref="Invoked"/></summary>
 /// <param name="e">Аргумент первичного вызова события</param>
 //[System.Diagnostics.DST]
 protected virtual void OnInvoked(Info e)
 {
     _LastEventArgs = e;
     Invoked?.Invoke(this, e);
 }
예제 #18
0
 /// <summary>
 /// Raises the <see cref="E:Invoked"/> event.
 /// </summary>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void OnInvoked(RoutedEventArgs e)
 {
     Invoked?.Invoke(this, e);
 }
 /// <summary>
 /// Callback for command invoking.
 /// </summary>
 /// <param name="result">Result.</param>
 protected virtual void OnInvoked(object result)
 {
     Invoked?.Invoke(this, result);
 }
예제 #20
0
 public virtual Task Invoke(T attribute, VMContext context, NextFilterDelegate next)
 {
     Invoked?.Invoke(this, Tuple.Create(attribute, context));
     return(next.Invoke(context));
 }
예제 #21
0
 /// <summary>
 /// Execute the build action.
 /// </summary>
 /// <param name="container">The dependency container</param>
 public void Invoke(IContainer container)
 {
     Action?.Invoke(container);
     Invoked?.Invoke(this);
     IsInvoked = true;
 }
예제 #22
0
 public virtual void InvokeAction(GameEventArgument args)
 {
     Invoked?.Invoke(args);
 }
예제 #23
0
 public virtual Task Invoke(DotNetifyHubContext context, NextDelegate next)
 {
     Invoked?.Invoke(this, context);
     context.PipelineData.Add(GetType().Name, null);
     return(next(context));
 }
 internal void RaiseInvoked(object sender, DwellInvokedRoutedEventArgs args)
 {
     Invoked?.Invoke(sender, args);
 }
 public Task OnDisconnected(HubCallerContext context)
 {
     Invoked?.Invoke(this, context);
     return(Task.CompletedTask);
 }
예제 #26
0
 public void Execute(object parameter)
 {
     Invoked?.Invoke((parameter as IconButton), this);
 }
예제 #27
0
        public async Task <ExecutionContext> InvokeAsync <TResult>(AbstractRequestContext requestContext)
        {
            Stopwatch stopwatch        = null;
            Guid      operationId      = Guid.Empty;
            var       executionContext = new ExecutionContext
            {
                Request        = requestContext,
                SmartSqlConfig = SmartSqlConfig,
                DbSession      = this,
            };

            try
            {
                if (_logger.IsEnabled(LogLevel.Debug))
                {
                    stopwatch = Stopwatch.StartNew();
                }
                operationId = _diagnosticListener.WriteDbSessionInvokeBefore(executionContext);
                #region Impl
                switch (executionContext.Type)
                {
                case ExecutionType.Execute:
                case ExecutionType.ExecuteScalar:
                case ExecutionType.QuerySingle:
                case ExecutionType.GetDataSet:
                case ExecutionType.GetDataTable:
                {
                    executionContext.Result = new SingleResultContext <TResult>();
                    break;
                }

                case ExecutionType.Query:
                {
                    executionContext.Result = new ListResultContext <TResult>();
                    break;
                }

                default:
                    throw new ArgumentOutOfRangeException();
                }
                requestContext.ExecutionContext = executionContext;
                await Pipeline.InvokeAsync <TResult>(executionContext);

                Invoked?.Invoke(this, new DbSessionInvokedEventArgs {
                    ExecutionContext = executionContext
                });
                #endregion
                _diagnosticListener.WriteDbSessionInvokeAfter(operationId, executionContext);
                return(executionContext);
            }
            catch (Exception ex)
            {
                _diagnosticListener.WriteDbSessionInvokeError(operationId, executionContext, ex);
                throw;
            }
            finally
            {
                if (_logger.IsEnabled(LogLevel.Debug))
                {
                    _logger.LogDebug(
                        $"Statement.Id:{requestContext.FullSqlId} Invoke Taken:{stopwatch?.ElapsedMilliseconds}.");
                }
            }
        }
예제 #28
0
 public override void Invoke()
 {
     Invoked?.Invoke(this);
 }