/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. using System;
  19. using System.Windows.Media;
  20. using ICSharpCode.AvalonEdit.Editing;
  21. #if NREFACTORY
  22. using ICSharpCode.NRefactory.Editor;
  23. #else
  24. using ICSharpCode.AvalonEdit.Document;
  25. #endif
  26. namespace ICSharpCode.AvalonEdit.CodeCompletion
  27. {
  28. /// <summary>
  29. /// Describes an entry in the <see cref="CompletionList"/>.
  30. /// </summary>
  31. public interface ICompletionData
  32. {
  33. /// <summary>
  34. /// Gets the image.
  35. /// </summary>
  36. ImageSource Image { get; }
  37. /// <summary>
  38. /// Gets the text. This property is used to filter the list of visible elements.
  39. /// </summary>
  40. string Text { get; }
  41. /// <summary>
  42. /// The displayed content. This can be the same as 'Text', or a WPF UIElement if
  43. /// you want to display rich content.
  44. /// </summary>
  45. object Content { get; }
  46. /// <summary>
  47. /// Gets the description.
  48. /// </summary>
  49. object Description { get; }
  50. /// <summary>
  51. /// Gets the priority. This property is used in the selection logic. You can use it to prefer selecting those items
  52. /// which the user is accessing most frequently.
  53. /// </summary>
  54. double Priority { get; }
  55. /// <summary>
  56. /// Perform the completion.
  57. /// </summary>
  58. /// <param name="textArea">The text area on which completion is performed.</param>
  59. /// <param name="completionSegment">The text segment that was used by the completion window if
  60. /// the user types (segment between CompletionWindow.StartOffset and CompletionWindow.EndOffset).</param>
  61. /// <param name="insertionRequestEventArgs">The EventArgs used for the insertion request.
  62. /// These can be TextCompositionEventArgs, KeyEventArgs, MouseEventArgs, depending on how
  63. /// the insertion was triggered.</param>
  64. void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs);
  65. }
  66. }