public override void ExecuteAsync(string typeName, object state, ExecuteStateCompleted executeCompleted, params object[] parameters) { Assert.ArgumentNotNull(typeName, nameof(typeName)); Assert.ArgumentNotNull(executeCompleted, nameof(executeCompleted)); Assert.ArgumentNotNull(parameters, nameof(parameters)); if (!typeName.StartsWith(Constants.SitecoreRocksServer + @".Requests.")) { typeName = Constants.SitecoreRocksServer + ".Requests." + typeName; } EventHandler <ExecuteCompletedEventArgs> callback = (sender, args) => { Action action = delegate { EndCommunication(); var executeResult = new ExecuteResult(this, args.Error, args.Cancelled); if (args.Error != null) { executeCompleted(string.Empty, executeResult, state); } else { executeCompleted(args.Result.Trim(), executeResult, state); } }; Dispatcher.CurrentDispatcher.BeginInvoke(new Action(action)); }; Action fail = delegate { var executeResult = new ExecuteResult(this, new Exception(@"No Service"), false); executeCompleted(string.Empty, executeResult, state); }; AppHost.Usage.ReportRequest(typeName); Execute(() => ExecuteExecuteAsync(typeName, parameters, callback), fail); }
public abstract void ExecuteAsync([NotNull, Localizable(false)] string typeName, [CanBeNull] object state, [NotNull] ExecuteStateCompleted executeCompleted, [NotNull, Localizable(false)] params object[] parameters);
public override void ExecuteAsync(string typeName, object state, ExecuteStateCompleted executeCompleted, params object[] parameters) { Assert.ArgumentNotNull(typeName, nameof(typeName)); Assert.ArgumentNotNull(executeCompleted, nameof(executeCompleted)); Assert.ArgumentNotNull(parameters, nameof(parameters)); }