public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            string str = tokenStream.Peek().get_Key();
            switch (str)
            {
                case null:
                    break;

                case "OpenCurlyBraceToken":
                    outliningKey = "CodeBlock";
                    tokenAction = 1;
                    break;

                case "CloseCurlyBraceToken":
                    outliningKey = "CodeBlock";
                    tokenAction = 2;
                    break;

                default:
                    if (!(str == "MultiLineCommentStartToken"))
                    {
                        if (str == "MultiLineCommentEndToken")
                        {
                            outliningKey = "MultiLineComment";
                            tokenAction = 2;
                        }
                    }
                    else
                    {
                        outliningKey = "MultiLineComment";
                        tokenAction = 1;
                    }
                    break;
            }
        }
예제 #2
0
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            Token token = tokenStream.Peek();

            if ((token.Key == "OpenCurlyBraceToken" || token.Key == "CloseCurlyBraceToken") && g.Config.b_Ed_CodeFold == false)
                return;

            switch (token.Key) {
                case "OpenCurlyBraceToken":
                    outliningKey = "CodeBlock";
                    tokenAction = OutliningNodeAction.Start;
                    break;
                case "CloseCurlyBraceToken":
                    outliningKey = "CodeBlock";
                    tokenAction = OutliningNodeAction.End;
                    break;
                case "RegionStartToken":
                    outliningKey = "CodeRegion";
                    tokenAction = OutliningNodeAction.Start;
                    break;
                case "RegionEndToken":
                    outliningKey = "CodeRegion";
                    tokenAction = OutliningNodeAction.End;
                    break;
            }
        }
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        // PUBLIC PROCEDURES
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Returns token parsing information for automatic outlining that determines if the current <see cref="IToken"/>
        /// in the <see cref="TokenStream"/> starts or ends an outlining node.
        /// </summary>
        /// <param name="tokenStream">A <see cref="TokenStream"/> that is positioned at the <see cref="IToken"/> requiring outlining data.</param>
        /// <param name="outliningKey">Returns the outlining node key to assign.  A <see langword="null"/> should be returned if the token doesn't start or end a node.</param>
        /// <param name="tokenAction">Returns the <see cref="OutliningNodeAction"/> to take for the token.</param>
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            // Get the token
            IToken token = tokenStream.Peek();

            // See if the token starts or ends an outlining node
            switch (token.Key)
            {
                case "MultiLineCommentStartToken":
                    outliningKey = "MultiLineComment";
                    tokenAction = OutliningNodeAction.Start;
                    break;
                case "MultiLineCommentEndToken":
                    outliningKey = "MultiLineComment";
                    tokenAction = OutliningNodeAction.End;
                    break;
                case "RegionStartToken":
                    outliningKey = "Region";
                    tokenAction = OutliningNodeAction.Start;
                    break;
                case "EndRegionStartToken":
                    outliningKey = "Region";
                    tokenAction = OutliningNodeAction.End;
                    break;
            }
        }
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            switch (tokenStream.Peek().get_Key())
            {
                case "OpenCurlyBraceToken":
                    outliningKey = "CodeBlock";
                    tokenAction = 1;
                    break;

                case "CloseCurlyBraceToken":
                    outliningKey = "CodeBlock";
                    tokenAction = 2;
                    break;

                case "MultiLineCommentStartToken":
                    outliningKey = "MultiLineComment";
                    tokenAction = 1;
                    break;

                case "MultiLineCommentEndToken":
                    outliningKey = "MultiLineComment";
                    tokenAction = 2;
                    break;

                case "XMLCommentStartToken":
                    outliningKey = "XMLComment";
                    tokenAction = 1;
                    break;

                case "XMLCommentEndToken":
                    outliningKey = "XMLComment";
                    tokenAction = 2;
                    break;

                case "RegionPreProcessorDirectiveStartToken":
                    outliningKey = "RegionPreProcessorDirective";
                    tokenAction = 1;
                    break;

                case "EndRegionPreProcessorDirectiveEndToken":
                    outliningKey = "RegionPreProcessorDirective";
                    tokenAction = 2;
                    break;
            }
        }
 public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
 {
     IToken token = tokenStream.Peek();
     if ((token.get_Key() == "StartTagStartToken") && (token.get_DeclaringLexicalState().get_Key() == "StartTagState"))
     {
         outliningKey = "Region";
         tokenAction = 1;
     }
     else if (((token.get_Key() == "StartTagEndToken") && (token.get_DeclaringLexicalState().get_Key() == "StartTagState")) && (tokenStream.get_Document().GetSubstring(token.get_TextRange()) == "/>"))
     {
         outliningKey = "Region";
         tokenAction = 2;
     }
     else if ((token.get_Key() == "EndTagEndToken") && (token.get_DeclaringLexicalState().get_Key() == "EndTagState"))
     {
         outliningKey = "Region";
         tokenAction = 2;
     }
 }
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            switch (tokenStream.Peek().get_Key())
            {
            case "OpenCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = 1;
                break;

            case "CloseCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = 2;
                break;

            case "MultiLineCommentStartToken":
                outliningKey = "MultiLineComment";
                tokenAction  = 1;
                break;

            case "MultiLineCommentEndToken":
                outliningKey = "MultiLineComment";
                tokenAction  = 2;
                break;

            case "XMLCommentStartToken":
                outliningKey = "XMLComment";
                tokenAction  = 1;
                break;

            case "XMLCommentEndToken":
                outliningKey = "XMLComment";
                tokenAction  = 2;
                break;

            case "RegionPreProcessorDirectiveStartToken":
                outliningKey = "RegionPreProcessorDirective";
                tokenAction  = 1;
                break;

            case "EndRegionPreProcessorDirectiveEndToken":
                outliningKey = "RegionPreProcessorDirective";
                tokenAction  = 2;
                break;
            }
        }
예제 #7
0
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            // Get the token
            IToken token = tokenStream.Peek();
            if (token == null)
                return;

            if (string.IsNullOrEmpty(token.Key))
                return;

            // See if the token starts or ends an outlining node
            switch (token.Key)
            {
                //case "OpenCurlyBraceToken":
                //    outliningKey = "CodeBlock";
                //    tokenAction = OutliningNodeAction.Start;
                //    break;

                //case "CloseCurlyBraceToken":
                //    outliningKey = "CodeBlock";
                //    tokenAction = OutliningNodeAction.End;
                //    break;

                case ReservedWordToken:
                {
                    string tokenString = token.AutoCaseCorrectText;
                    if (string.IsNullOrEmpty(tokenString))
                        return;

                    switch (tokenString)
                    {
                        case "do":
                        //case "while": // while's also contain "do"
                        //case "for":   // for's also contain "do"
                        case "if":
                        case "repeat":
                        case "function":
                            outliningKey = "CodeBlock";
                            tokenAction = OutliningNodeAction.Start;
                            break;

                        case "until":
                        case "end":
                            outliningKey = "CodeBlock";
                            tokenAction = OutliningNodeAction.End;
                            break;
                    }
                }
                break;

                case MultiLineCommentStartToken:
                    outliningKey = "MultiLineComment";
                    tokenAction = OutliningNodeAction.Start;
                    break;

                case MultiLineCommentEndToken:
                    outliningKey = "MultiLineComment";
                    tokenAction = OutliningNodeAction.End;
                    break;
            }
        }
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        // PUBLIC PROCEDURES
        /////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Returns token parsing information for automatic outlining that determines if the current <see cref="IToken"/>
        /// in the <see cref="TokenStream"/> starts or ends an outlining node.
        /// </summary>
        /// <param name="tokenStream">A <see cref="TokenStream"/> that is positioned at the <see cref="IToken"/> requiring outlining data.</param>
        /// <param name="outliningKey">Returns the outlining node key to assign.  A <see langword="null"/> should be returned if the token doesn't start or end a node.</param>
        /// <param name="tokenAction">Returns the <see cref="OutliningNodeAction"/> to take for the token.</param>
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            // Get the token
            IToken token = tokenStream.Peek();

            // See if the token starts or ends an outlining node
            switch (token.Key)
            {
            case "MultiLineCommentStartToken":
                outliningKey = "MultiLineComment";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case "MultiLineCommentEndToken":
                outliningKey = "MultiLineComment";
                tokenAction  = OutliningNodeAction.End;
                break;

            case "RegionStartToken":
                outliningKey = "Region";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case "EndRegionStartToken":
                outliningKey = "Region";
                tokenAction  = OutliningNodeAction.End;
                break;
            }
        }
예제 #9
0
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            Token token = tokenStream.Peek();

            if ((token.Key == "OpenCurlyBraceToken" || token.Key == "CloseCurlyBraceToken") && g.Config.b_Ed_CodeFold == false)
            {
                return;
            }

            switch (token.Key)
            {
            case "OpenCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case "CloseCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = OutliningNodeAction.End;
                break;

            case "RegionStartToken":
                outliningKey = "CodeRegion";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case "RegionEndToken":
                outliningKey = "CodeRegion";
                tokenAction  = OutliningNodeAction.End;
                break;
            }
        }
예제 #10
0
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            IToken token = tokenStream.Peek();

            switch ((token.get_Language().get_Key() + "_" + token.get_Key()))
            {
            case "CSS_PropertyStartToken":
                outliningKey = "CSS_PropertyBlock";
                tokenAction  = 1;
                break;

            case "CSS_PropertyEndToken":
                outliningKey = "CSS_PropertyBlock";
                tokenAction  = 2;
                break;

            case "CSS_CommentStartToken":
                outliningKey = "CSS_Comment";
                tokenAction  = 1;
                break;

            case "CSS_CommentEndToken":
                outliningKey = "CSS_Comment";
                tokenAction  = 2;
                break;

            case "JScript_OpenCurlyBraceToken":
                outliningKey = "JScript_CodeBlock";
                tokenAction  = 1;
                break;

            case "JScript_CloseCurlyBraceToken":
                outliningKey = "JScript_CodeBlock";
                tokenAction  = 2;
                break;

            case "JScript_MultiLineCommentStartToken":
                outliningKey = "JScript_MultiLineComment";
                tokenAction  = 1;
                break;

            case "JScript_MultiLineCommentEndToken":
                outliningKey = "JScript_MultiLineComment";
                tokenAction  = 2;
                break;

            default:
                if (tokenAction != 0)
                {
                    if (token.HasFlag(0x40))
                    {
                        if ((tokenStream.get_Position() > 0) && (tokenStream.ReadReverse().get_LexicalState().get_Key() == "ASPDirectiveResponseWriteState"))
                        {
                            outliningKey = null;
                            tokenAction  = 0;
                        }
                    }
                    else if (token.HasFlag(0x80))
                    {
                        tokenStream.Read();
                        if (!tokenStream.get_IsDocumentEnd() && (tokenStream.Peek().get_LexicalState().get_Key() == "ASPDirectiveResponseWriteState"))
                        {
                            outliningKey = null;
                            tokenAction  = 0;
                        }
                    }
                }
                break;
            }
        }
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            switch (tokenStream.Peek().get_Key())
            {
                case "XMLCommentStartToken":
                    outliningKey = "XMLComment";
                    tokenAction = 1;
                    break;

                case "XMLCommentEndToken":
                    outliningKey = "XMLComment";
                    tokenAction = 2;
                    break;

                case "SubReservedWordToken":
                    outliningKey = "SubBlock";
                    tokenAction = 1;
                    break;

                case "EndSubReservedWordToken":
                    outliningKey = "SubBlock";
                    tokenAction = 2;
                    break;

                case "FunctionReservedWordToken":
                    outliningKey = "FunctionBlock";
                    tokenAction = 1;
                    break;

                case "EndFunctionReservedWordToken":
                    outliningKey = "FunctionBlock";
                    tokenAction = 2;
                    break;

                case "PropertyReservedWordToken":
                    outliningKey = "PropertyBlock";
                    tokenAction = 1;
                    break;

                case "EndPropertyReservedWordToken":
                    outliningKey = "PropertyBlock";
                    tokenAction = 2;
                    break;

                case "ClassReservedWordToken":
                    outliningKey = "ClassBlock";
                    tokenAction = 1;
                    break;

                case "EndClassReservedWordToken":
                    outliningKey = "ClassBlock";
                    tokenAction = 2;
                    break;

                case "InterfaceReservedWordToken":
                    outliningKey = "InterfaceBlock";
                    tokenAction = 1;
                    break;

                case "EndInterfaceReservedWordToken":
                    outliningKey = "InterfaceBlock";
                    tokenAction = 2;
                    break;

                case "EnumReservedWordToken":
                    outliningKey = "EnumBlock";
                    tokenAction = 1;
                    break;

                case "EndEnumReservedWordToken":
                    outliningKey = "EnumBlock";
                    tokenAction = 2;
                    break;

                case "StructureReservedWordToken":
                    outliningKey = "StructureBlock";
                    tokenAction = 1;
                    break;

                case "EndStructureReservedWordToken":
                    outliningKey = "StructureBlock";
                    tokenAction = 2;
                    break;

                case "ModuleReservedWordToken":
                    outliningKey = "ModuleBlock";
                    tokenAction = 1;
                    break;

                case "EndModuleReservedWordToken":
                    outliningKey = "ModuleBlock";
                    tokenAction = 2;
                    break;

                case "NamespaceReservedWordToken":
                    outliningKey = "NamespaceBlock";
                    tokenAction = 1;
                    break;

                case "EndNamespaceReservedWordToken":
                    outliningKey = "NamespaceBlock";
                    tokenAction = 2;
                    break;

                case "RegionPreProcessorDirectiveStartToken":
                    outliningKey = "RegionPreProcessorDirective";
                    tokenAction = 1;
                    break;

                case "EndRegionPreProcessorDirectiveStartToken":
                    outliningKey = "RegionPreProcessorDirective";
                    tokenAction = 2;
                    break;
            }
        }
예제 #12
0
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            // Get the token
            var token = tokenStream.Peek();

            if (token == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(token.Key))
            {
                return;
            }

            // See if the token starts or ends an outlining node
            switch (token.Key)
            {
            //case "OpenCurlyBraceToken":
            //    outliningKey = "CodeBlock";
            //    tokenAction = OutliningNodeAction.Start;
            //    break;

            //case "CloseCurlyBraceToken":
            //    outliningKey = "CodeBlock";
            //    tokenAction = OutliningNodeAction.End;
            //    break;

            case ReservedWordToken:
            {
                var tokenString =
                    token.AutoCaseCorrectText;

                if (string.IsNullOrEmpty(tokenString))
                {
                    return;
                }

                switch (tokenString)
                {
                case "do":
                //case "while": // while's also contain "do"
                //case "for":   // for's also contain "do"
                case "if":
                case "repeat":
                case "function":
                    outliningKey = "CodeBlock";
                    tokenAction  = OutliningNodeAction.Start;
                    break;

                case "until":
                case "end":
                    outliningKey = "CodeBlock";
                    tokenAction  = OutliningNodeAction.End;
                    break;
                }
            }
            break;

            case MultiLineCommentStartToken:
                outliningKey = "MultiLineComment";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case MultiLineCommentEndToken:
                outliningKey = "MultiLineComment";
                tokenAction  = OutliningNodeAction.End;
                break;
            }
        }
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            IToken token = tokenStream.Peek();

            if ((token.get_Key() == "StartTagStartToken") && (token.get_DeclaringLexicalState().get_Key() == "StartTagState"))
            {
                outliningKey = "Region";
                tokenAction  = 1;
            }
            else if (((token.get_Key() == "StartTagEndToken") && (token.get_DeclaringLexicalState().get_Key() == "StartTagState")) && (tokenStream.get_Document().GetSubstring(token.get_TextRange()) == "/>"))
            {
                outliningKey = "Region";
                tokenAction  = 2;
            }
            else if ((token.get_Key() == "EndTagEndToken") && (token.get_DeclaringLexicalState().get_Key() == "EndTagState"))
            {
                outliningKey = "Region";
                tokenAction  = 2;
            }
        }
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            IToken token = tokenStream.Peek();
            switch ((token.get_Language().get_Key() + "_" + token.get_Key()))
            {
                case "CSS_PropertyStartToken":
                    outliningKey = "CSS_PropertyBlock";
                    tokenAction = 1;
                    break;

                case "CSS_PropertyEndToken":
                    outliningKey = "CSS_PropertyBlock";
                    tokenAction = 2;
                    break;

                case "CSS_CommentStartToken":
                    outliningKey = "CSS_Comment";
                    tokenAction = 1;
                    break;

                case "CSS_CommentEndToken":
                    outliningKey = "CSS_Comment";
                    tokenAction = 2;
                    break;

                case "JScript_OpenCurlyBraceToken":
                    outliningKey = "JScript_CodeBlock";
                    tokenAction = 1;
                    break;

                case "JScript_CloseCurlyBraceToken":
                    outliningKey = "JScript_CodeBlock";
                    tokenAction = 2;
                    break;

                case "JScript_MultiLineCommentStartToken":
                    outliningKey = "JScript_MultiLineComment";
                    tokenAction = 1;
                    break;

                case "JScript_MultiLineCommentEndToken":
                    outliningKey = "JScript_MultiLineComment";
                    tokenAction = 2;
                    break;

                default:
                    if (tokenAction != 0)
                    {
                        if (token.HasFlag(0x40))
                        {
                            if ((tokenStream.get_Position() > 0) && (tokenStream.ReadReverse().get_LexicalState().get_Key() == "ASPDirectiveResponseWriteState"))
                            {
                                outliningKey = null;
                                tokenAction = 0;
                            }
                        }
                        else if (token.HasFlag(0x80))
                        {
                            tokenStream.Read();
                            if (!tokenStream.get_IsDocumentEnd() && (tokenStream.Peek().get_LexicalState().get_Key() == "ASPDirectiveResponseWriteState"))
                            {
                                outliningKey = null;
                                tokenAction = 0;
                            }
                        }
                    }
                    break;
            }
        }
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        // PUBLIC PROCEDURES
        /////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Returns token parsing information for automatic outlining that determines if the current <see cref="IToken"/>
        /// in the <see cref="TokenStream"/> starts or ends an outlining node.
        /// </summary>
        /// <param name="tokenStream">A <see cref="TokenStream"/> that is positioned at the <see cref="IToken"/> requiring outlining data.</param>
        /// <param name="outliningKey">Returns the outlining node key to assign.  A <see langword="null"/> should be returned if the token doesn't start or end a node.</param>
        /// <param name="tokenAction">Returns the <see cref="OutliningNodeAction"/> to take for the token.</param>
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            // Get the token
            IToken token = tokenStream.Peek();

            // See if the token starts or ends an outlining node
            switch (token.Key)
            {
            case "OpenCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case "CloseCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = OutliningNodeAction.End;
                break;
            }
        }
예제 #16
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        // PUBLIC PROCEDURES
        /////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Returns token parsing information for automatic outlining that determines if the current <see cref="IToken"/>
        /// in the <see cref="TokenStream"/> starts or ends an outlining node.
        /// </summary>
        /// <param name="tokenStream">A <see cref="TokenStream"/> that is positioned at the <see cref="IToken"/> requiring outlining data.</param>
        /// <param name="outliningKey">Returns the outlining node key to assign.  A <see langword="null"/> should be returned if the token doesn't start or end a node.</param>
        /// <param name="tokenAction">Returns the <see cref="OutliningNodeAction"/> to take for the token.</param>
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
        }
예제 #17
0
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            string str = tokenStream.Peek().get_Key();

            switch (str)
            {
            case null:
                break;

            case "OpenCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = 1;
                break;

            case "CloseCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = 2;
                break;

            default:
                if (!(str == "MultiLineCommentStartToken"))
                {
                    if (str == "MultiLineCommentEndToken")
                    {
                        outliningKey = "MultiLineComment";
                        tokenAction  = 2;
                    }
                }
                else
                {
                    outliningKey = "MultiLineComment";
                    tokenAction  = 1;
                }
                break;
            }
        }
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC PROCEDURES
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Returns token parsing information for automatic outlining that determines if the current <see cref="IToken"/>
 /// in the <see cref="TokenStream"/> starts or ends an outlining node.
 /// </summary>
 /// <param name="tokenStream">A <see cref="TokenStream"/> that is positioned at the <see cref="IToken"/> requiring outlining data.</param>
 /// <param name="outliningKey">Returns the outlining node key to assign.  A <see langword="null"/> should be returned if the token doesn't start or end a node.</param>
 /// <param name="tokenAction">Returns the <see cref="OutliningNodeAction"/> to take for the token.</param>
 public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
 {
 }
예제 #19
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        // PUBLIC PROCEDURES
        /////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Returns token parsing information for automatic outlining that determines if the current <see cref="IToken"/>
        /// in the <see cref="TokenStream"/> starts or ends an outlining node.
        /// </summary>
        /// <param name="tokenStream">A <see cref="TokenStream"/> that is positioned at the <see cref="IToken"/> requiring outlining data.</param>
        /// <param name="outliningKey">Returns the outlining node key to assign.  A <see langword="null"/> should be returned if the token doesn't start or end a node.</param>
        /// <param name="tokenAction">Returns the <see cref="OutliningNodeAction"/> to take for the token.</param>
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            // Get the token
            IToken token = tokenStream.Peek();

            // See if the token starts or ends an outlining node
            switch (token.Key)
            {
            case "OpenCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case "CloseCurlyBraceToken":
                outliningKey = "CodeBlock";
                tokenAction  = OutliningNodeAction.End;
                break;

            case "MultiLineCommentStartToken":
                outliningKey = "MultiLineComment";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case "MultiLineCommentEndToken":
                outliningKey = "MultiLineComment";
                tokenAction  = OutliningNodeAction.End;
                break;

            case "XMLCommentStartToken":
                outliningKey = "XMLComment";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case "XMLCommentEndToken":
                outliningKey = "XMLComment";
                tokenAction  = OutliningNodeAction.End;
                break;

            case "RegionPreProcessorDirectiveStartToken":
                outliningKey = "RegionPreProcessorDirective";
                tokenAction  = OutliningNodeAction.Start;
                break;

            case "EndRegionPreProcessorDirectiveStartToken":
                outliningKey = "RegionPreProcessorDirective";
                tokenAction  = OutliningNodeAction.End;
                break;
            }
        }
예제 #20
0
        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            switch (tokenStream.Peek().get_Key())
            {
            case "XMLCommentStartToken":
                outliningKey = "XMLComment";
                tokenAction  = 1;
                break;

            case "XMLCommentEndToken":
                outliningKey = "XMLComment";
                tokenAction  = 2;
                break;

            case "SubReservedWordToken":
                outliningKey = "SubBlock";
                tokenAction  = 1;
                break;

            case "EndSubReservedWordToken":
                outliningKey = "SubBlock";
                tokenAction  = 2;
                break;

            case "FunctionReservedWordToken":
                outliningKey = "FunctionBlock";
                tokenAction  = 1;
                break;

            case "EndFunctionReservedWordToken":
                outliningKey = "FunctionBlock";
                tokenAction  = 2;
                break;

            case "PropertyReservedWordToken":
                outliningKey = "PropertyBlock";
                tokenAction  = 1;
                break;

            case "EndPropertyReservedWordToken":
                outliningKey = "PropertyBlock";
                tokenAction  = 2;
                break;

            case "ClassReservedWordToken":
                outliningKey = "ClassBlock";
                tokenAction  = 1;
                break;

            case "EndClassReservedWordToken":
                outliningKey = "ClassBlock";
                tokenAction  = 2;
                break;

            case "InterfaceReservedWordToken":
                outliningKey = "InterfaceBlock";
                tokenAction  = 1;
                break;

            case "EndInterfaceReservedWordToken":
                outliningKey = "InterfaceBlock";
                tokenAction  = 2;
                break;

            case "EnumReservedWordToken":
                outliningKey = "EnumBlock";
                tokenAction  = 1;
                break;

            case "EndEnumReservedWordToken":
                outliningKey = "EnumBlock";
                tokenAction  = 2;
                break;

            case "StructureReservedWordToken":
                outliningKey = "StructureBlock";
                tokenAction  = 1;
                break;

            case "EndStructureReservedWordToken":
                outliningKey = "StructureBlock";
                tokenAction  = 2;
                break;

            case "ModuleReservedWordToken":
                outliningKey = "ModuleBlock";
                tokenAction  = 1;
                break;

            case "EndModuleReservedWordToken":
                outliningKey = "ModuleBlock";
                tokenAction  = 2;
                break;

            case "NamespaceReservedWordToken":
                outliningKey = "NamespaceBlock";
                tokenAction  = 1;
                break;

            case "EndNamespaceReservedWordToken":
                outliningKey = "NamespaceBlock";
                tokenAction  = 2;
                break;

            case "RegionPreProcessorDirectiveStartToken":
                outliningKey = "RegionPreProcessorDirective";
                tokenAction  = 1;
                break;

            case "EndRegionPreProcessorDirectiveStartToken":
                outliningKey = "RegionPreProcessorDirective";
                tokenAction  = 2;
                break;
            }
        }