public static CloneClass GetCloneClass(IVsTextLineMarker marker) { IVsTextLines textLines; ErrorHandler.ThrowOnFailure(marker.GetLineBuffer(out textLines)); DocumentInfo documentInfo; if (_textLinesToDocInfos.TryGetValue(textLines, out documentInfo)) { CloneClass cloneClass; if (documentInfo.MarkersToCloneClasses.TryGetValue(marker, out cloneClass)) { return(cloneClass); } } return(null); }
internal static void OnMarkerInvalidated(IVsTextLineMarker marker) { // Remove the invalidated marker reference from our dictionary of // markers. Since this dictionary is held in another one we have // to get the text buffer of the marker first. IVsTextLines textLines; ErrorHandler.ThrowOnFailure(marker.GetLineBuffer(out textLines)); DocumentInfo documentInfo; if (_textLinesToDocInfos.TryGetValue(textLines, out documentInfo)) { if (documentInfo.MarkersToCloneClasses.ContainsKey(marker)) { documentInfo.MarkersToCloneClasses.Remove(marker); } } }