/// <summary> /// Initializes a debug document /// </summary> private void Initialize() { int documentStartPosition = 0; int documentEndPosition = _code.Length - 1; int lineBreakPosition = int.MinValue; int lineBreakLength = 0; uint lineNumber = 1; do { int linePosition = lineBreakPosition == int.MinValue ? documentStartPosition : lineBreakPosition + lineBreakLength; int remainderLength = documentEndPosition - linePosition + 1; FindLineBreak(_code, linePosition, remainderLength, out lineBreakPosition, out lineBreakLength); int lineLength = lineBreakPosition != -1 ? lineBreakPosition - linePosition : 0; _lines.Add(new DebugLineInfo(lineNumber, (uint)linePosition, (uint)lineLength, (uint)lineBreakLength)); lineNumber++; }while (lineBreakPosition != -1 && lineBreakPosition <= documentEndPosition); _debugApplicationWrapper.CreateApplicationNode(out _node); _node.SetDocumentProvider(this); IDebugApplicationNode rootNode; _debugApplicationWrapper.GetRootNode(out rootNode); _node.Attach(rootNode); }
private void Initialize() { codeLines = Code.Split('\n').Select(line => line + '\n').ToArray(); engine.debugApplication.CreateApplicationNode(out node); node.SetDocumentProvider(this); engine.debugApplication.GetRootNode(out var rootNode); node.Attach(rootNode); }