コード例 #1
0
ファイル: XMLCodeCompleter.cs プロジェクト: t3hm00kz/Assembly
		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);
		}
コード例 #2
0
 protected void OnAttributeCompletionAvailable(AttributeCompletionEventArgs args)
 {
     if (AttributeCompletionAvailable != null)
     {
         AttributeCompletionAvailable(this, args);
     }
 }
コード例 #3
0
ファイル: PluginEditor.xaml.cs プロジェクト: ChadSki/Assembly
        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();
        }
コード例 #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);
        }
コード例 #5
0
ファイル: XMLCodeCompleter.cs プロジェクト: t3hm00kz/Assembly
		protected void OnAttributeCompletionAvailable(AttributeCompletionEventArgs args)
		{
			if (AttributeCompletionAvailable != null)
				AttributeCompletionAvailable(this, args);
		}