//private static List<LineSpan> GetExposedLineSpans (ITextSnapshot textSnapshot) //{ // const string start = "//["; // const string end = "//]"; // var bufferText = textSnapshot.GetText ().ToString (); // var lineSpans = new List<LineSpan> (); // var lastEndIndex = 0; // while (true) { // var startIndex = bufferText.IndexOf (start, lastEndIndex, StringComparison.Ordinal); // if (startIndex == -1) { // break; // } // var endIndex = bufferText.IndexOf (end, lastEndIndex, StringComparison.Ordinal); // var startLine = textSnapshot.GetLineNumberFromPosition (startIndex) + 1; // var endLine = textSnapshot.GetLineNumberFromPosition (endIndex); // lineSpans.Add (LineSpan.FromBounds (startLine, endLine)); // lastEndIndex = endIndex + end.Length; // } // return lineSpans; //} public void Dispose() { if (_textViewHost != null) { _textViewHost.Dispose(); _textViewHost = null; } if (curWorkspace != null) { curWorkspace.Dispose(); curWorkspace = null; } }