Esempio n. 1
0
		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);
		}
Esempio n. 2
0
 protected void OnAttributeCompletionAvailable(AttributeCompletionEventArgs args)
 {
     if (AttributeCompletionAvailable != null)
     {
         AttributeCompletionAvailable(this, args);
     }
 }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
		protected void OnAttributeCompletionAvailable(AttributeCompletionEventArgs args)
		{
			if (AttributeCompletionAvailable != null)
				AttributeCompletionAvailable(this, args);
		}