private void Runner_OnRowEndExecute(object sender, Keyrox.Scripting.Events.ScriptLineEventArgs e) { if (InDebugMode) { this.Invoke(new Callback(delegate() { RestoreRows(); var row = Editor.Document[e.Line.LineIndex]; if (StopDebuggerIn == StepTo.NextRow || row.Breakpoint) { row.BackColor = Color.Yellow; row.Images.Clear(); row.Images.Add(22); btnBarNext.Enabled = true; btnBarNextBreakPoint.Enabled = true; } else { Runner.ResumeExecution(); } row.EnsureVisible(); Document.ParseRow(row); Editor.Refresh(); })); } }
private void Runner_OnScriptException(object sender, Keyrox.Scripting.Events.ScriptExceptionEventArgs e) { errorList1.Add(new ScriptLineError(e.Exception.Message, scriptBox1.Editor.Document[e.RowIndex], ScriptLineErrorType.Error)); AddInnerExceptions(e); }
/// <summary> /// Handles the OnActionComplete event of the row control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Keyrox.Scripting.Events.ScriptLineEventArgs"/> instance containing the event data.</param> public void row_OnActionComplete(object sender, Keyrox.Scripting.Events.ScriptLineEventArgs e) { if (e.Line.Result.MustReExecute) { CheckExecutionContinue(e); } if (!e.Line.Result.Success) { Stop(); return; } if (e.Line.IsSection) { CurrentLineIndexToGoBack = 0; } if (e.Line.IsEndSection && CurrentLineIndexToGoBack > 0) { CurrentLineIndex = CurrentLineIndexToGoBack; CurrentLineIndexToGoBack = 0; CheckExecutionContinue(e); return; } if (e.Line.Result.MustPause) { Pause(); return; } if (e.Line.Result.MustStop) { Stop(); return; } if (e.Line.Result.SectionToJump != null) { CurrentLineIndex = e.Line.Result.SectionToJump.StartLine.LineIndex; CheckExecutionContinue(e); return; } if (e.Line.Result.SectionToExecute != null) { CurrentLineIndexToGoBack = CurrentLineIndex; CurrentLineIndex = e.Line.Result.SectionToExecute.StartLine.LineIndex + 1; CheckExecutionContinue(e); return; } if (e.Line.Result.LineToJump != null) { CurrentLineIndex = e.Line.Result.LineToJump.LineIndex; CheckExecutionContinue(e); return; } var row = File.GetNextLine(CurrentLineIndex); if (row != null) { CurrentLineIndex = row.LineIndex; CheckExecutionContinue(e); } else { Stop(); } //End of script. }
public void GoToWord(Keyrox.SourceCode.Word word) { scriptBox1.Editor.GotoLine(word.Row.Index); }
private void Compiler_OnProgressReport(object sender, Keyrox.Scripting.Events.NumberEventArgs e) { this.Invoke(new Callback(delegate() { BuildProgressBar.UnLockEvents(); BuildProgressBarItem.BeginUpdate(); BuildProgressBar.BeginUpdate(); BuildProgressBarItem.EditValue = e.Value; BuildProgressBar.EndUpdate(); BuildProgressBarItem.EndUpdate(); BuildProgressBarItem.Refresh(); })); }
private void Editor_AutoListRequested(object sender, Keyrox.Scripting.Events.AutoListTypeEventArgs e) { if (e.Type == Keyrox.Scripting.AutoListType.None) { autoListBox1.Hide(); } else { autoListBox1.Show(e.Type); } }
private void Document_BreakPointRemoved(object sender, Keyrox.SourceCode.RowEventArgs e) { scriptBox1.Editor.Document.ParseRow(e.Row); }
public void ShowErrorTip(Keyrox.SourceCode.Word word) { ScriptToolTipController.ShowHint(word.BuildErrorTip(), Cursor.Position); }
private void Compiler_OnProgressReport(object sender, Keyrox.Scripting.Events.NumberEventArgs e) { this.BeginInvoke(new Callback(delegate() { ParseProgressBar.BeginUpdate(); ParseProgressBar.EditValue = Convert.ToInt32(ParseProgressBar.EditValue) + 1; ParseProgressBar.EndUpdate(); this.Invalidate(new Rectangle(ribbonStatusBar1.Location, ribbonStatusBar1.Size), true); if (OnInvalidateRequired != null) { OnInvalidateRequired(this, EventArgs.Empty); } })); }
private void Document_BreakPointAdded(object sender, Keyrox.SourceCode.RowEventArgs e) { if (!e.Row.Text.Contains("(")) { Editor.Document[e.Row.Index].Breakpoint = false; ReparseRow(e.Row.Index); return; } if (!e.Row.Text.EndsWith(")")) { Editor.Document[e.Row.Index].Breakpoint = false; ReparseRow(e.Row.Index); return; } if (e.Row.Text.Trim().Length == 0) { Editor.Document[e.Row.Index].Breakpoint = false; ReparseRow(e.Row.Index); return; } if (e.Row.Text.StartsWith(@"\")) { Editor.Document[e.Row.Index].Breakpoint = false; ReparseRow(e.Row.Index); return; } if (e.Row.Text.StartsWith(" ")) { Editor.Document[e.Row.Index].Breakpoint = false; ReparseRow(e.Row.Index); return; } if (e.Row.Text.StartsWith("#")) { Editor.Document[e.Row.Index].Breakpoint = false; ReparseRow(e.Row.Index); return; } e.Row.Images.Clear(); }
private void AddInnerExceptions(Keyrox.Scripting.Events.ExceptionEventArgs e) { this.BeginInvoke(new Callback(delegate() { var innerException = e.Exception.InnerException; while (innerException != null) { errorList1.Add(new ScriptLineError(e.Exception.Message, (Keyrox.SourceCode.Row)null, ScriptLineErrorType.Error)); innerException = innerException.InnerException; } })); }
private void AddInnerExceptions(Keyrox.Scripting.Events.ScriptExceptionEventArgs e) { this.BeginInvoke(new Callback(delegate() { var innerException = e.Exception.InnerException; while (innerException != null) { errorList1.Add(new ScriptLineError(innerException.Message, scriptBox1.Editor.Document[e.RowIndex], ScriptLineErrorType.Error)); innerException = innerException.InnerException; } })); }
public void ShowWarningTip(Keyrox.SourceCode.Word word) { this.BeginInvoke(new Callback(delegate() { ScriptToolTipController.ShowHint(word.BuildWarningTip(), Cursor.Position); })); }
public void GoToRow(Keyrox.SourceCode.Row row) { //if (row.Count > 0) { // scriptBox1.Editor.Selection.LogicalBounds.SetBounds(row[0].Column, row.Index, row[0].Column, row.Index); // scriptBox1.Editor.Selection.MakeSelection(); //} scriptBox1.Editor.GotoLine(row.Index); }
private void Document_RowParsed(object sender, Keyrox.SourceCode.RowEventArgs e) { if (Runner == null || Runner.State == Keyrox.Scripting.Util.RunnerState.Stoped) { if (!e.Row.Breakpoint) { if (e.Row.Text.StartsWith("///") && e.Row.Images.Count == 0) { e.Row.Images.Add(10); } else if (e.Row.Text.StartsWith("#section") && e.Row.Images.Count == 0) { e.Row.Images.Add(36); } else if (e.Row.Text.Contains("checkvalue") && e.Row.Images.Count == 0) { e.Row.Images.Add(33); } else if (e.Row.Text.Contains("setparam") && e.Row.Images.Count == 0) { e.Row.Images.Add(28); } else if (e.Row.Text.StartsWith("log") && e.Row.Images.Count == 0) { e.Row.Images.Add(35); } else if (e.Row.Text.StartsWith("setloot") && e.Row.Images.Count == 0) { e.Row.Images.Add(37); } else if (e.Row.Text.StartsWith("gotoline") && e.Row.Images.Count == 0) { e.Row.Images.Add(3); } else if (e.Row.Text.StartsWith("gotosection") && e.Row.Images.Count == 0) { e.Row.Images.Add(3); } } } }
public void GoToWord(Keyrox.SourceCode.Word word) { //scriptBox1.Editor.Selection.LogicalBounds.SetBounds(word.Column, word.Row.Index, word.Column, word.Index); //scriptBox1.Editor.Selection.MakeSelection(); scriptBox1.Editor.GotoLine(word.Row.Index); }
private void Editor_RowMouseDown(object sender, Keyrox.Windows.Forms.SyntaxBox.RowMouseEventArgs e) { if (e.Button == MouseButtons.Right) { editorContextMenu.ShowPopup(Cursor.Position); } HideSuperTip(); autoListBox1.Hide(); }
private void Compiler_OnOutputChange(object sender, Keyrox.Scripting.Events.TextEventArgs e) { SetStatusText(e.Text); }
private void Editor_RowMouseMove(object sender, Keyrox.Windows.Forms.SyntaxBox.RowMouseEventArgs e) { this.BeginInvoke(new Callback(delegate() { var x = (e.MouseX - 66); if (x >= 0) { x = Convert.ToInt32(x / 8); var word = scriptBox1.Editor.Document.GetWordFromPos(e.Row, x, e.MouseY); if (word != null) { if (word.HasError) { if (!string.IsNullOrEmpty(word.ErrorTip)) { ShowErrorTip(word); return; } if (!string.IsNullOrEmpty(word.WarningTip)) { ShowWarningTip(word); return; } } if (!ShowSuperTipOnMouseMove) { return; } if (word.Row.Text.StartsWith("#section")) { return; } var key = ScriptKeywords.FindKeyword(word.Text, scriptBox1.Editor); if (key != null) { ShowSuperTip(key); return; } } } HideSuperTip(); })); }
private void Compiler_OnScriptError(object sender, Keyrox.Scripting.Events.LineErrorEventArgs e) { errorList1.Add(e.Error); }
private void Runner_OnException(object sender, Keyrox.Scripting.Events.ExceptionEventArgs e) { errorList1.Add(new ScriptLineError(e.Exception.Message, (Keyrox.SourceCode.Row)null, ScriptLineErrorType.Error)); AddInnerExceptions(e); }
private void Editor_RowMouseMove(object sender, Keyrox.Windows.Forms.SyntaxBox.RowMouseEventArgs e) { var x = (e.MouseX - 66); if (x >= 0) { x = Convert.ToInt32(x / 8); var word = scriptBox1.Editor.Document.GetWordFromPos(e.Row, x, e.MouseY); if (word != null) { if (word.ErrorTip != null) { ShowErrorTip(word); return; } if (!ShowSuperTipOnMouseMove) { return; } if (word.Row.Text.StartsWith("#section")) { return; } var key = ScriptKeywords.FindKeyword(word.Text, scriptBox1.Editor); if (key != null) { ShowSuperTip(key); return; } } } HideSuperTip(); }
private void Runner_OnRowBeginExecute(object sender, Keyrox.Scripting.Events.ScriptLineEventArgs e) { if (InDebugMode) { this.Invoke(new Callback(delegate() { RestoreRows(); var row = Editor.Document[e.Line.LineIndex]; row.BackColor = Color.LightBlue; row.Images.Clear(); row.Images.Add(18); btnBarNext.Enabled = false; btnBarNextBreakPoint.Enabled = false; row.EnsureVisible(); Document.ParseRow(row); Editor.Refresh(); })); } }
/// <summary> /// Checks the execution continue. /// </summary> /// <param name="e">The <see cref="Keyrox.Scripting.Events.ScriptLineEventArgs"/> instance containing the event data.</param> private void CheckExecutionContinue(Keyrox.Scripting.Events.ScriptLineEventArgs e) { if (InDebugMode) { if (OnRowEndExecute != null) { OnRowEndExecute.BeginInvoke(this, new ScriptLineEventArgs(e.Line), null, this); } return; } else { ExecuteCurrentLine(); return; } }
public void GoToRow(Keyrox.SourceCode.Row row) { scriptBox1.Editor.GotoLine(row.Index); }