public void Toggle(ITextEditorUIContext uiContext, int line, int column = 0) { var bps = uiContext.GetCodeMappings().Find(line, column); var ilbps = GetILCodeBreakpoints(uiContext, bps); if (ilbps.Count > 0) { if (IsEnabled(ilbps)) { foreach (var ilbp in ilbps) { Remove(ilbp); } } else { foreach (var bpm in ilbps) { bpm.IsEnabled = true; } } } else if (bps.Count > 0) { foreach (var bp in bps) { var md = bp.Mapping.Method; var serMod = serializedDnModuleCreator.Create(md.Module); var key = new SerializedDnToken(serMod, md.MDToken); Add(new ILCodeBreakpoint(key, bp.ILRange.From)); } uiContext.ScrollAndMoveCaretTo(bps[0].StartPosition.Line, bps[0].StartPosition.Column); } }
public ITextMarker CreateMarker(ITextEditorUIContext uiContext, ITextMarkerService markerService) { var marker = CreateMarkerInternal(markerService, uiContext); var cm = uiContext.GetCodeMappings(); marker.ZOrder = ZOrder; marker.IsVisible = b => cm.TryGetMapping(SerializedDnToken) != null; marker.TextMarkerObject = this; Initialize(uiContext, markerService, marker); return marker; }
public ITextMarker CreateMarker(ITextEditorUIContext uiContext, ITextMarkerService markerService) { var marker = CreateMarkerInternal(markerService, uiContext); var cm = uiContext.GetCodeMappings(); marker.ZOrder = ZOrder; marker.IsVisible = b => cm.TryGetMapping(SerializedDnToken) != null; marker.TextMarkerObject = this; Initialize(uiContext, markerService, marker); return(marker); }
public override bool IsVisible(ITextEditorUIContext uiContext) { TextPosition location, endLocation; var cm = uiContext.GetCodeMappings(); var mm = cm.TryGetMapping(SerializedDnToken); if (mm == null) return false; if (!mm.GetInstructionByTokenAndOffset(ILOffset, out location, out endLocation)) return false; return true; }
public override bool IsVisible(ITextEditorUIContext uiContext) { TextPosition location, endLocation; var cm = uiContext.GetCodeMappings(); var mm = cm.TryGetMapping(SerializedDnToken); if (mm == null) { return(false); } if (!mm.GetInstructionByTokenAndOffset(ILOffset, out location, out endLocation)) { return(false); } return(true); }
internal static IList <SourceCodeMapping> GetMappings(ITextEditorUIContext uiContext, int line, int col) { if (uiContext == null) { return(null); } var cm = uiContext.GetCodeMappings(); var list = cm.Find(line, col); if (list.Count == 0) { return(null); } if (!(list[0].StartPosition.Line <= line && line <= list[0].EndPosition.Line)) { return(null); } return(list); }
public bool GetLocation(ITextEditorUIContext uiContext, out TextPosition location, out TextPosition endLocation) { var cm = uiContext.GetCodeMappings(); var mapping = cm.TryGetMapping(methodKey); if (mapping == null) { location = endLocation = new TextPosition(); return false; } bool isMatch; var map = mapping.GetInstructionByOffset(ilOffset, out isMatch); if (map == null) { location = endLocation = new TextPosition(); return false; } location = map.StartPosition; endLocation = map.EndPosition; return true; }
public bool GetLocation(ITextEditorUIContext uiContext, out TextPosition location, out TextPosition endLocation) { var cm = uiContext.GetCodeMappings(); var mapping = cm.TryGetMapping(methodKey); if (mapping == null) { location = endLocation = new TextPosition(); return(false); } bool isMatch; var map = mapping.GetInstructionByOffset(ilOffset, out isMatch); if (map == null) { location = endLocation = new TextPosition(); return(false); } location = map.StartPosition; endLocation = map.EndPosition; return(true); }
internal static IList<SourceCodeMapping> GetMappings(ITextEditorUIContext uiContext, int line, int col) { if (uiContext == null) return null; var cm = uiContext.GetCodeMappings(); var list = cm.Find(line, col); if (list.Count == 0) return null; if (!(list[0].StartPosition.Line <= line && line <= list[0].EndPosition.Line)) return null; return list; }
List <ILCodeBreakpoint> GetILCodeBreakpoints(ITextEditorUIContext uiContext, int line, int column) { return(GetILCodeBreakpoints(uiContext, uiContext.GetCodeMappings().Find(line, column))); }
List<ILCodeBreakpoint> GetILCodeBreakpoints(ITextEditorUIContext uiContext, int line, int column) { return GetILCodeBreakpoints(uiContext, uiContext.GetCodeMappings().Find(line, column)); }
public void Toggle(ITextEditorUIContext uiContext, int line, int column = 0) { var bps = uiContext.GetCodeMappings().Find(line, column); var ilbps = GetILCodeBreakpoints(uiContext, bps); if (ilbps.Count > 0) { if (IsEnabled(ilbps)) { foreach (var ilbp in ilbps) Remove(ilbp); } else { foreach (var bpm in ilbps) bpm.IsEnabled = true; } } else if (bps.Count > 0) { foreach (var bp in bps) { var md = bp.Mapping.Method; var serMod = serializedDnModuleCreator.Create(md.Module); var key = new SerializedDnToken(serMod, md.MDToken); Add(new ILCodeBreakpoint(key, bp.ILRange.From)); } uiContext.ScrollAndMoveCaretTo(bps[0].StartPosition.Line, bps[0].StartPosition.Column); } }
public static bool VerifyAndGetCurrentDebuggedMethod(ITextEditorUIContext uiContext, SerializedDnToken serToken, out CodeMappings codeMappings) { codeMappings = uiContext.GetCodeMappings(); return codeMappings.TryGetMapping(serToken) != null; }
public static bool VerifyAndGetCurrentDebuggedMethod(ITextEditorUIContext uiContext, SerializedDnToken serToken, out CodeMappings codeMappings) { codeMappings = uiContext.GetCodeMappings(); return(codeMappings.TryGetMapping(serToken) != null); }