private void delete(RequestHandlerArgument arg) { var executor = new Executer(arg.MessageBody); var result = executor.Execute(); arg.Response(result); }
public ReferenceResultOutput RunExecution(GULossAdaptor guLossAdaptor) { GraphExecuter Executer; switch (graphInfo.Style) { case AutoGraphStyle.Matrix: Executer = new GraphOfMatrixExecuter(graph as GraphOfMatrix); break; case AutoGraphStyle.Node: if (graph is PrimaryGraph) { Executer = new PrimaryGraphOfNodesExecuter(graph as PrimaryGraph); } else if (graph is TreatyGraph) { Executer = new TreatyGraphOfNodesExecuter(graph as TreatyGraph); } else { throw new NotSupportedException("Can only handle Node graphs of type Treaty and Primary type"); } break; default: throw new NotSupportedException("Can only handle graph of style Matrix or Node"); } return(Executer.Execute(guLossAdaptor)); }
protected override async void LoadItemsAsync() { if (!_favoritesStorage.Any()) { Items = null; return; } IsBusy = true; IEnumerable <Trigger> triggers; try { triggers = await Executer.Execute(() => TriggerProxyServer.GetTriggers(null, null, null, Select.Extend, _favoritesStorage.Favorites().Select(f => f.Id).ToList())); } catch (Exception ex) { ErrorHandler.Handle(ex); return; } finally { IsBusy = false; } Items = triggers.OrderBy(trigger => trigger.IsOk) .ThenByDescending(trigger => trigger.Priority) .ThenBy(trigger => trigger.Description) .ToList(); }
private async void LoginAsync(UserCredentials userCredentials) { IsBusy = !ValidatingSession; try { await Executer.Execute(() => _userManagmentFacade.LoginAsync(userCredentials)); } catch (Exception ex) { ValidatingSession = false; IsBusy = false; Username = userCredentials.Username; Password = userCredentials.Password; _errorHandler.Handle(ex); return; } UpdateApplicationSettings(userCredentials); _eventAggregator.Unsubscribe(this); _analyticsService.Login(RememberMe); _navigationService.UriFor <MainPageViewModel>() .WithParam(vm => vm.TriggerIdFromToast, TriggerIdFromToast) .Navigate(); IsBusy = false; }
public void executerTest3() { Executer executer = new Executer("sub main\nset b 2\nprint b\nset a 3\nprint a"); string output = executer.Execute(new System.Threading.CancellationToken()); Assert.AreEqual("b=2\na=3\n", output); }
public void executerTest5() { Executer executer = new Executer("sub main\ncall main"); string output = executer.Execute(new System.Threading.CancellationToken()); Assert.AreEqual("StackOverflowExeption\n", output); }
protected override async void LoadItemsAsync() { IsBusy = true; IEnumerable <Trigger> triggers; try { triggers = await Executer.Execute(() => TriggerProxyServer.GetTriggers(null, null, null, Select.Extend)); } catch (Exception ex) { ErrorHandler.Handle(ex); return; } finally { IsBusy = false; } Items = triggers.OrderBy(trigger => trigger.IsOk) .ThenByDescending(trigger => trigger.Priority) .ThenBy(trigger => trigger.Description) .Take(DEFAULT_ITEMS_COUNT) .ToList(); }
protected override async void LoadItemsAsync() { IsBusy = true; //uint? hostId = HostId > 0 ? HostId : (uint?)null; IEnumerable <Trigger> triggers; try { triggers = await Executer.Execute(() => TriggerProxyServer.GetTriggers(HostId, null, null, Select.None)); } catch (Exception ex) { ErrorHandler.Handle(ex); return; } finally { IsBusy = false; } Items = triggers.OrderBy(trigger => trigger.IsOk) .ThenByDescending(trigger => trigger.Priority) .ThenBy(trigger => trigger.Description) .ToList(); }
public static void Main(string[] args) { string file = null; if (args.Length > 0 && File.Exists(args[0])) { file = args[0]; } if (file == null) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Open"; dialog.FileName = ""; dialog.Multiselect = false; dialog.Filter = "Tbasic 2.0 Script (*.tba)|*.tba|All Files (*.*)|*.*"; if (dialog.ShowDialog() == DialogResult.OK) { file = dialog.FileName; } else { return; } } try { Executer exec = new Executer(); exec.Global.LoadStandardLibrary(); exec.Execute(File.ReadAllLines(file)); } catch (ScriptParsingException ex) { MessageBox.Show(ex.Message, "Tbasic Script Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void executerTest4() { Executer executer = new Executer("sub main\nset a 2\nprint a\ncall foo\nsub foo\nset a 3\ncall boo\nsub boo\nprint a"); string output = executer.Execute(new System.Threading.CancellationToken()); Assert.AreEqual("a=2\na=3\n", output); }
public void STOPTest() { string expected = "00 00 00 00 00 00 00 00 00 00 00 00 00 00"; string result = Executer.Execute("stop;"); AreEqual(expected, result); }
public void CBRTest() { string expected = "00 00 00 00 00 00 00 00 FC 22 00 00 00 00"; string result = Executer.Execute("if R1 goto R2;"); AreEqual(expected, result); }
public void STTest() { string expected = "00 00 00 00 00 00 00 00 CC 22 00 00 00 00"; string result = Executer.Execute("*R1 := R2;"); AreEqual(expected, result); }
public void LDCTest() { string expected = "00 00 00 00 00 00 00 00 C8 A1 00 00 00 00"; string result = Executer.Execute("R1 := 5;"); AreEqual(expected, result); }
public void LDTest() { string expected = "00 00 00 00 00 00 00 00 C4 22 00 00 00 00"; string result = Executer.Execute("R1 := *R2;"); AreEqual(expected, result); }
public void ASRest() { string expected = "00 00 00 00 00 00 00 00 DC 22 00 00 00 00"; string result = Executer.Execute("R1 >>= R2;"); AreEqual(expected, result); }
public void LDATest() { string expected = "00 00 00 00 00 00 00 00 08 41 00 00 00 05 00 00 00 00"; string result = Executer.Execute("R1 := R2 + 5;"); AreEqual(expected, result); }
public void ASLTest() { string expected = "00 00 00 00 00 00 00 00 E0 22 00 00 00 00"; string result = Executer.Execute("R1 <<= R2;"); AreEqual(expected, result); }
public void CNDTest() { string expected = "00 00 00 00 00 00 00 00 F8 22 00 00 00 00"; string result = Executer.Execute("R1 ?= R2;"); AreEqual(expected, result); }
public void ORTest() { string expected = "00 00 00 00 00 00 00 00 E4 22 00 00 00 00"; string result = Executer.Execute("R1 |= R2;"); AreEqual(expected, result); }
public void AddTest() { string expected = "00 00 00 00 00 00 00 00 D4 22 00 00 00 00"; string result = Executer.Execute("R1 += R2;"); AreEqual(expected, result); }
public void MOVTest() { string expected = "00 00 00 00 00 00 00 00 D0 22 00 00 00 00"; string result = Executer.Execute("R1 := R2;"); AreEqual(expected, result); }
public void Run(int startFrom = 0) { try { if (Running) { Interrupt(); } Running = true; Interval = 0; Executer executer = new Executer(); generic.Oriole.ExecutingScene = this; for (int i = startFrom; i < EXData.Length; EXLine = i, i++) { if (!Running) { break; } else { UI.SelectLine(i); if (EXData[i].Length < 1) { continue; } if (EXData[i][0] != NOSLEEP_SIGNATURE) { System.Threading.Thread.Sleep(Interval); } if (EXData[i].ToLower() == END_SIGNATURE) { Interrupt(); } else { executer.Execute(EXData[i]); } } } generic.Oriole.ExecutingScene = null; } catch (Exception e) { Interrupt(); MessageBox.Show(e.Message + " Line: " + (EXLine + 1), "Interpretation error! Interrupted.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void Update(IServices services) { EnsureInitialized(); while (true) { if (_currentState != null) { if (!_currentState.IsCompleted) { return; } _currentState = null; } if (_currentExecutor != null) { while (_currentExecutor.Next(out var current)) { if (current == null) { throw new InvalidOperationException(); } if (current == BreakAwaitable.Instance) { break; } if (current == SpinAwaitable.Instance) { return; } _currentState = current.GetAwaiter(); if (!_currentState.IsCompleted) { return; } } _currentState = null; _currentExecutor.Complete(); _currentExecutor = null; } if (_executionQueue.Count <= 0) { break; } _currentExecutor = _executionQueue.Dequeue(); _currentExecutor.Execute(services); } }
public override void Execute() { Retain(); // This method shows that execution will take some time, important for commandBinder.Bind<>().InSequence()... Debug.Log("F**k Yeee!"); coinsBalanceChangedSignal.AddListener(OnBalanceChange); Executer.Execute(WaitAndGo()); }
void Start() { compileButton.onClick.AddListener(() => { try { consoleArea = executer.Execute(textArea); } catch (Exception e) { consoleArea = "Exception caught.\nExecution failed\n\n" + e.Message + "\n\n" + e.StackTrace; } }); }
public string Execute(string query) { try { var executor = new Executer(query); var result = executor.Execute().ToString(Newtonsoft.Json.Formatting.Indented); return(ResponseString(RoseResult.Ok, "Ok", result)); } catch (Exception e) { return(ResponseString(RoseResult.UnknownError, e.Message, null)); } }
/// <summary> /// اجرای قوانین برای پرسنل مشخص شده /// </summary> public void GTS_ExecuteByPersonID(string CallerIdentity, decimal PersonId) { try { Executer engine = new Executer(); engine.Execute(CallerIdentity, PersonId, DateTime.Now.Date); } catch (BaseException ex) { logger.Logger.Error(String.Format("Error On TotalWebservice PersonID:{0},Message:{1}", PersonId, ex.GetLogMessage())); logger.Flush(); throw new GTSWebserviceException(ex.GetLogMessage(), String.Format("TotalWebService.GTS_ExecuteByPersonID({0})", PersonId)); } }
public override void Execute(Executer exec) { if (!Header.Text.EndsWithIgnoreCase(" then")) { throw ThrowHelper.ExpectedToken("THEN"); } Evaluator eval = new Evaluator( new StringSegment(Header.Text, Header.Text.IndexOf(' ') + 1, // Get rid of the IF Header.Text.LastIndexOf(' ') - 2), // Get rid of the THEN exec ); if (eval.EvaluateBool()) { exec.Execute(Body); } else if (HasElseBlock) { exec.Execute(Else.Body); } }
private void executeToolStripMenuItem_Click(object sender, EventArgs e) { try { Executer executer = new Executer(readProcesesFromTable(dataGridMain)); Proces.TcList.Clear(); executer.Execute(); UpdateTableFromExecuter(dataGridMain, executer); } catch (Exception ex) { MessageBox.Show(ex.Message); Proces.TcList.Clear(); } }
static IAsyncResult beginOperation(BaseCommand command, AsyncCallback callback, object state) { Executer exe = new Executer(callback, state, command); ThreadPool.QueueUserWorkItem(s => exe.Execute()); return exe.AsyncResult; }
static IAsyncResult beginOperation(BaseCommand command, AsyncCallback callback, object state) { TransferAsyncResult result = new TransferAsyncResult(callback, state); Executer exe = new Executer(result, command); ThreadPool.QueueUserWorkItem(s => exe.Execute()); return result; }