Esempio n. 1
0
 public XmlCompletionItemCollection GetAttributeValueCompletion(char charTyped, string textUpToCursor, XmlSchemaCompletion defaultSchema)
 {
     if (XmlParser.IsAttributeValueChar(charTyped))
     {
         var attributeName = XmlParser.GetAttributeName(textUpToCursor, textUpToCursor.Length);
         if (attributeName.Length > 0)
         {
             var elementPath = XmlParser.GetActiveElementStartPath(textUpToCursor, textUpToCursor.Length);
             return(GetAttributeValueCompletion(elementPath, attributeName, defaultSchema));
         }
     }
     return(new XmlCompletionItemCollection());
 }
Esempio n. 2
0
 public XmlCompletionItemCollection GetAttributeCompletion(string textUpToCursor, XmlSchemaCompletion defaultSchema)
 {
     if (!XmlParser.IsInsideAttributeValue(textUpToCursor, textUpToCursor.Length))
     {
         var path = XmlParser.GetActiveElementStartPath(textUpToCursor, textUpToCursor.Length);
         path.Compact();
         if (path.Elements.HasItems)
         {
             return(GetAttributeCompletion(path, defaultSchema));
         }
     }
     return(new XmlCompletionItemCollection());
 }