PageRenderTime 8ms CodeModel.GetById 5ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/ICompletionData.cs

http://github.com/icsharpcode/ILSpy
C# | 73 lines | 20 code | 7 blank | 46 comment | 0 complexity | fc57b4f54c54c4fbe6d4c69bbb499dcf MD5 | raw file
 1// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
 2// 
 3// Permission is hereby granted, free of charge, to any person obtaining a copy of this
 4// software and associated documentation files (the "Software"), to deal in the Software
 5// without restriction, including without limitation the rights to use, copy, modify, merge,
 6// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
 7// to whom the Software is furnished to do so, subject to the following conditions:
 8// 
 9// The above copyright notice and this permission notice shall be included in all copies or
10// substantial portions of the Software.
11// 
12// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
15// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17// DEALINGS IN THE SOFTWARE.
18
19using System;
20using System.Windows.Media;
21using ICSharpCode.AvalonEdit.Editing;
22#if NREFACTORY
23using ICSharpCode.NRefactory.Editor;
24#else
25using ICSharpCode.AvalonEdit.Document;
26#endif
27
28namespace ICSharpCode.AvalonEdit.CodeCompletion
29{
30	/// <summary>
31	/// Describes an entry in the <see cref="CompletionList"/>.
32	/// </summary>
33	public interface ICompletionData
34	{
35		/// <summary>
36		/// Gets the image.
37		/// </summary>
38		ImageSource Image { get; }
39		
40		/// <summary>
41		/// Gets the text. This property is used to filter the list of visible elements.
42		/// </summary>
43		string Text { get; }
44		
45		/// <summary>
46		/// The displayed content. This can be the same as 'Text', or a WPF UIElement if
47		/// you want to display rich content.
48		/// </summary>
49		object Content { get; }
50		
51		/// <summary>
52		/// Gets the description.
53		/// </summary>
54		object Description { get; }
55		
56		/// <summary>
57		/// Gets the priority. This property is used in the selection logic. You can use it to prefer selecting those items
58		/// which the user is accessing most frequently.
59		/// </summary>
60		double Priority { get; }
61		
62		/// <summary>
63		/// Perform the completion.
64		/// </summary>
65		/// <param name="textArea">The text area on which completion is performed.</param>
66		/// <param name="completionSegment">The text segment that was used by the completion window if
67		/// the user types (segment between CompletionWindow.StartOffset and CompletionWindow.EndOffset).</param>
68		/// <param name="insertionRequestEventArgs">The EventArgs used for the insertion request.
69		/// These can be TextCompositionEventArgs, KeyEventArgs, MouseEventArgs, depending on how
70		/// the insertion was triggered.</param>
71		void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs);
72	}
73}