Posted 20 years ago
by Jan van de Pol
![Avatar](https://secure.gravatar.com/avatar/17c1957f80643c67df466f11a517cbba.jpg?s=64&d=identicon&r=g)
I have overridden GetTokenOutliningAction in order to enable expanding and collapsing for XML nodes. My method looks as follows:
protected override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction) {
// Get the token
Token token = tokenStream.Peek();
string languageTokenKey = token.Language.Key + "_" + token.Key;
// See if the token starts or ends an outlining node
switch (languageTokenKey) {
case "XML_StartTagEndToken":
outliningKey = "XML_Block";
tokenAction = OutliningNodeAction.Start;
break;
case "XML_EndTagStartToken":
outliningKey = "XML_Block";
tokenAction = OutliningNodeAction.End;
break;
}
}
I use the provided XML language definition. The collapse will result in something like:
<MyNode...MyNode>. I'm trying to get something like:
<MyNode myAttribut='MyValue'>...</MyNode>
Anyone knowing how to achieve this?
protected override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction) {
// Get the token
Token token = tokenStream.Peek();
string languageTokenKey = token.Language.Key + "_" + token.Key;
// See if the token starts or ends an outlining node
switch (languageTokenKey) {
case "XML_StartTagEndToken":
outliningKey = "XML_Block";
tokenAction = OutliningNodeAction.Start;
break;
case "XML_EndTagStartToken":
outliningKey = "XML_Block";
tokenAction = OutliningNodeAction.End;
break;
}
}
I use the provided XML language definition. The collapse will result in something like:
<MyNode...MyNode>. I'm trying to get something like:
<MyNode myAttribut='MyValue'>...</MyNode>
Anyone knowing how to achieve this?