当前位置: 首页>>代码示例>>C#>>正文


C# IVsTextLines.CreateLineMarker方法代码示例

本文整理汇总了C#中IVsTextLines.CreateLineMarker方法的典型用法代码示例。如果您正苦于以下问题:C# IVsTextLines.CreateLineMarker方法的具体用法?C# IVsTextLines.CreateLineMarker怎么用?C# IVsTextLines.CreateLineMarker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVsTextLines的用法示例。


在下文中一共展示了IVsTextLines.CreateLineMarker方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: addMarker

        private static void addMarker(IVsTextLines textLines, int line, int start, int end)
        {
            TextMarkerClientEventSink clientEventSinkBackground = new TextMarkerClientEventSink();
            TextMarkerClientEventSink clientEventSinkMargin = new TextMarkerClientEventSink();

            IVsTextLineMarker[] markers = new IVsTextLineMarker[1];

            int hr = textLines.CreateLineMarker(JiraLinkBackgroundMarkerType.Id, line, start, line, end, clientEventSinkBackground, markers);
            if (!ErrorHandler.Succeeded(hr)) return;
            clientEventSinkBackground.BackgroundMarker = markers[0];

            hr = textLines.CreateLineMarker(JiraLinkMarginMarkerType.Id, line, start, line, end, clientEventSinkMargin, markers);

            if (!ErrorHandler.Succeeded(hr)) return;
            clientEventSinkMargin.MarginMarker = markers[0];
        }
开发者ID:spncrgr,项目名称:connector-idea,代码行数:16,代码来源:JiraEditorLinkManager.cs

示例2: NemerleTextMarkerClient

        public NemerleTextMarkerClient(IVsTextLines buffer, Location loc)
        {
            Location = loc;

            var markerRef = new IVsTextLineMarker[1];

            var hr = buffer.CreateLineMarker((int)MARKERTYPE2.MARKER_SMARTTAG_FACTOID,
                loc.Line - 1, loc.Column - 1, loc.EndLine - 1, loc.EndColumn - 1, this, markerRef);

            Debug.Assert(hr == 0);

            if (hr == 0) // S_OK
            {
                TextLineMarker = markerRef[0];
                string[] ss = new string[1];
                uint i;
                TextLineMarker.GetVisualStyle(out i);
                //TextLineMarker.SetVisualStyle((uint)MARKERVISUAL.MV_SEL_MARGIN_GLYPH);
                Debug.Assert(true);
            }
        }
开发者ID:vestild,项目名称:nemerle,代码行数:21,代码来源:NemerleTextMarkerClient.cs

示例3: CreateMarker

    public static IVsTextLineMarker CreateMarker( IVsTextLines textLines, TextSpan span, MARKERTYPE mt, string tipText) {

      IVsTextLineMarker marker = null;    
      TextMarkerClient textMarkerClient = new TextMarkerClient( tipText );
      textLines.CreateLineMarker((int)mt, span.iStartLine, span.iStartIndex, 
        span.iEndLine, span.iEndIndex, textMarkerClient, out marker);
      return marker;
    }
开发者ID:hesam,项目名称:SketchSharp,代码行数:8,代码来源:TaskItem.cs

示例4: MakeTextMarker

        public void MakeTextMarker(IVsTextLines buffer)
        {
            Trace.Assert(TextLineMarker == null);
            if (TextLineMarker != null)
                DisposeTextLineMarker();

            var span = Utils.SpanFromLocation(CompilerMessage.Location);
            int markerType;
            switch (CompilerMessage.Kind)
            {
                case MessageKind.Error:   markerType = (int)MARKERTYPE.MARKER_CODESENSE_ERROR;  break;
                case MessageKind.Warning: markerType = (int)MARKERTYPE.MARKER_COMPILE_ERROR;    break;
                default:                  markerType = (int)MARKERTYPE2.MARKER_WARNING;         break;
            }

            // create marker so task item navigation works even after file is edited.
            IVsTextLineMarker[] marker = new IVsTextLineMarker[1];
            // bugbug: the following comment in the method CEnumMarkers::Initialize() of
            // ~\env\msenv\textmgr\markers.cpp means that tool tips on empty spans
            // don't work:
            //      "VS7 #23719/#15312 [CFlaat]: exclude adjacent markers when the target span is non-empty"
            // So I wonder if we should debug assert on that or try and modify the span
            // in some way to make it non-empty...
            ErrorHandler.ThrowOnFailure(buffer.CreateLineMarker(markerType, span.iStartLine, span.iStartIndex,
                span.iEndLine, span.iEndIndex, this, marker));

            _textLineMarker = marker[0];
        }
开发者ID:vestild,项目名称:nemerle,代码行数:28,代码来源:NemerleErrorTask.cs

示例5: OnOpenFile

 private void OnOpenFile(IVsTextLines textLines)
 {
   if (!isDeleted && marker == null && textLines != null) {
     // Common.Trace("Task.OnOpenFile: " + location);
     const MARKERTYPE MARKER_COMPILE_WARNING = (MARKERTYPE)11;
     MARKERTYPE mtype;
     switch (markerType) {
       case TaskMarker.CodeSense: mtype = MARKERTYPE.MARKER_CODESENSE_ERROR; break;
       case TaskMarker.Error: mtype = MARKERTYPE.MARKER_COMPILE_ERROR; break;
       case TaskMarker.Warning: mtype = MARKER_COMPILE_WARNING; break;
       case TaskMarker.Other: mtype = MARKERTYPE.MARKER_OTHER_ERROR; break;
       case TaskMarker.Invisible: mtype = MARKERTYPE.MARKER_INVISIBLE; break; 
       default:
         if ((int)markerType  < (int)MARKERTYPE.DEF_MARKER_COUNT)
           mtype = (MARKERTYPE)markerType;
         else
           mtype = MARKERTYPE.MARKER_INVISIBLE; break; // still create a marker to track position changes
     }
     IVsTextLineMarker[] markers = new IVsTextLineMarker[1];
     TextSpan ts = location.TextSpan;
     textLines.CreateLineMarker((int)mtype
                               , ts.iStartLine, ts.iStartIndex, ts.iEndLine, ts.iEndIndex
                               , this, markers);
     marker = markers[0];
   }
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:26,代码来源:Task.cs

示例6: CreateTextLineMarker

        public void CreateTextLineMarker(IVsTextLines buffer)
        {
            RemoveTextLineMarker();

            var tasks = this.Tasks;

            if (!tasks.Any())
            {
                return;
            }

            int markerType = (int)MARKERTYPE.MARKER_INVISIBLE;

            var errorCategory = tasks.Min(x => x.ErrorCategory);

            switch (errorCategory)
            {
                case TaskErrorCategory.Message:
                    markerType = (int)MARKERTYPE.MARKER_COMPILE_ERROR;
                    break;
                case TaskErrorCategory.Warning:
                    markerType = (int)MARKERTYPE2.MARKER_WARNING;
                    break;
                case TaskErrorCategory.Error:
                    markerType = (int)MARKERTYPE.MARKER_CODESENSE_ERROR;
                    break;
            }

            int iStartLine = this.PackageReference.StartLine - 1;
            int iStartIndex = this.PackageReference.StartPos;
            int iEndLine = this.PackageReference.EndLine - 1;
            int iEndIndex = this.PackageReference.EndPos;

            // create marker
            IVsTextLineMarker[] marker = new IVsTextLineMarker[1];

            ErrorHandler.ThrowOnFailure(buffer.CreateLineMarker(markerType, iStartLine, iStartIndex, iEndLine, iEndIndex, this, marker));
                                   
            _textLineMarker = marker[0];
        }
开发者ID:OSSIndex,项目名称:audit.net,代码行数:40,代码来源:PackageReferenceMarker.cs


注:本文中的IVsTextLines.CreateLineMarker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。