/// <summary>
        /// Returns the list of code blocks in the generated .cs file that comes from the ASP.NET
        /// markup compiler. These blocks of code are delimited by #line directives (ExternSource
        /// directives in VB). The TextSpan that we return is the span of the lines between the
        /// start #line and ending #line default directives (#End ExternSource in VB), and the
        /// cookie is the numeric line number given in the #line directive.
        /// </summary>
        public int EnumOriginalCodeBlocks(out IVsEnumCodeBlocks ppEnum)
        {
            var waitIndicator = ComponentModel.GetService <IWaitIndicator>();

            IList <TextSpanAndCookie> result = null;

            waitIndicator.Wait(
                "Intellisense",
                allowCancel: false,
                action: c => result = EnumOriginalCodeBlocksWorker(c.CancellationToken));

            ppEnum = new CodeBlockEnumerator(result);
            return(VSConstants.S_OK);
        }
        public int EnumOriginalCodeBlocks(out IVsEnumCodeBlocks ppEnum)
        {
            IList <TextSpanAndCookie> result = null;

            var uiThreadOperationExecutor = ComponentModel.GetService <IUIThreadOperationExecutor>();

            uiThreadOperationExecutor.Execute(
                "Intellisense",
                defaultDescription: "",
                allowCancellation: false,
                showProgress: false,
                action: c => result = EnumOriginalCodeBlocksWorker(c.UserCancellationToken));

            ppEnum = new CodeBlockEnumerator(result);
            return(VSConstants.S_OK);
        }
Exemplo n.º 3
0
 public int Clone(out IVsEnumCodeBlocks ppEnum)
 {
     ppEnum = new CodeBlockEnumerator(this);
     return(VSConstants.S_OK);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Clones another instance of a CodeBlockEnumerator.
 /// </summary>
 private CodeBlockEnumerator(CodeBlockEnumerator previousEnumerator)
 {
     _codeBlocks     = previousEnumerator._codeBlocks;
     _currentElement = previousEnumerator._currentElement;
 }
Exemplo n.º 5
0
 public int Clone(out IVsEnumCodeBlocks ppEnum)
 {
     ppEnum = new CodeBlockEnumerator(this);
     return VSConstants.S_OK;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Clones another instance of a CodeBlockEnumerator.
 /// </summary>
 private CodeBlockEnumerator(CodeBlockEnumerator previousEnumerator)
 {
     _codeBlocks = previousEnumerator._codeBlocks;
     _currentElement = previousEnumerator._currentElement;
 }