public void Invoke() { command.Invoke(parameters); lastStart = DateTime.Now; Invoked?.Invoke(this, EventArgs.Empty); }
void TrayIcon_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { Invoked.Invoke(); } }
/// <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); }
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); } }
public virtual CfrV8Value Invoke(CfrV8HandlerExecuteEventArgs args, JsBinding binding, HtmlTextureWrapper wrapper) { var res = Function(args, binding, wrapper); Invoked?.Invoke(this, wrapper); InvokeCount++; return(res); }
private void OnTick(object sender, object e) { _timer.Stop(); Invoked?.Invoke(_lastSender, _lastArgs); _lastSender = null; _lastArgs = default; }
public void OnInvoked() { if (Command != null && Command.CanExecute(CommandParameter)) { Command.Execute(CommandParameter); } Invoked?.Invoke(this, EventArgs.Empty); }
void Maui.ISwipeItem.OnInvoked() { if (Command != null && Command.CanExecute(CommandParameter)) { Command.Execute(CommandParameter); } OnClicked(); Invoked?.Invoke(this, EventArgs.Empty); }
public static void OnInvoked(ApiInvokedArgs args) { try { Invoked?.Invoke(null, args); } catch (Exception ex) { throw new ApiInvocationException("Handling Api Invoked event failed.", ex); } }
public Task <bool> Invoke(string code = "", string install = "") { var args = new OAuthAcceptanceEventArgs() { Code = code, Install = install }; Invoked?.Invoke(this, args); return(Task.FromResult(true)); }
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)); }
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) { } }
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); } }
public Task Invoke(CustomFilter1Attribute attribute, VMContext context, NextFilterDelegate next) { Invoked?.Invoke(this, Tuple.Create(attribute, context)); return(next.Invoke(context)); }
/// <summary>Метод первичной генерации события <see cref="Invoked"/></summary> /// <param name="e">Аргумент первичного вызова события</param> //[System.Diagnostics.DST] protected virtual void OnInvoked(Info e) { _LastEventArgs = e; Invoked?.Invoke(this, e); }
/// <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); }
public virtual Task Invoke(T attribute, VMContext context, NextFilterDelegate next) { Invoked?.Invoke(this, Tuple.Create(attribute, context)); return(next.Invoke(context)); }
/// <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; }
public virtual void InvokeAction(GameEventArgument args) { Invoked?.Invoke(args); }
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); }
public void Execute(object parameter) { Invoked?.Invoke((parameter as IconButton), this); }
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}."); } } }
public override void Invoke() { Invoked?.Invoke(this); }