public void CompleteAttributeName(string line, int caretColumn) { // Get information about what's being worked on XMLAnalysis analysis = XMLAnalysis.AnalyzeLine(line, caretColumn); if (!analysis.CanInsertAttribute) return; // Get the tag that's being worked on CompletableXMLTag tag; if (!_tagsByName.TryGetValue(analysis.CurrentTag, out tag)) return; // Only suggest attributes which haven't been defined yet var suggestions = new List<CompletableXMLAttribute>(); foreach (CompletableXMLAttribute attribute in tag.Attributes) { if (!analysis.Attributes.Contains(attribute.Name)) suggestions.Add(attribute); } if (suggestions.Count == 0) return; // Raise the AttributeCompletionAvailable event var args = new AttributeCompletionEventArgs(suggestions); OnAttributeCompletionAvailable(args); }
protected void OnAttributeCompletionAvailable(AttributeCompletionEventArgs args) { if (AttributeCompletionAvailable != null) { AttributeCompletionAvailable(this, args); } }
private void AttributeCompletionAvailable(object sender, AttributeCompletionEventArgs e) { _completionWindow = new CompletionWindow(txtPlugin.TextArea); IList<ICompletionData> data = _completionWindow.CompletionList.CompletionData; foreach (CompletableXMLAttribute tag in e.Suggestions) data.Add(new XMLAttributeCompletionData(tag, _completer)); _completionWindow.Show(); }
public void CompleteAttributeName(string line, int caretColumn) { // Get information about what's being worked on XMLAnalysis analysis = XMLAnalysis.AnalyzeLine(line, caretColumn); if (!analysis.CanInsertAttribute) { return; } // Get the tag that's being worked on CompletableXMLTag tag; if (!_tagsByName.TryGetValue(analysis.CurrentTag, out tag)) { return; } // Only suggest attributes which haven't been defined yet var suggestions = new List <CompletableXMLAttribute>(); foreach (CompletableXMLAttribute attribute in tag.Attributes) { if (!analysis.Attributes.Contains(attribute.Name)) { suggestions.Add(attribute); } } if (suggestions.Count == 0) { return; } // Raise the AttributeCompletionAvailable event var args = new AttributeCompletionEventArgs(suggestions); OnAttributeCompletionAvailable(args); }
protected void OnAttributeCompletionAvailable(AttributeCompletionEventArgs args) { if (AttributeCompletionAvailable != null) AttributeCompletionAvailable(this, args); }