/AvalonEdit/ICSharpCode.AvalonEdit/Snippets/IActiveElement.cs

http://github.com/icsharpcode/ILSpy · C# · 50 lines · 13 code · 5 blank · 32 comment · 0 complexity · f4e7d75fcbfa7047c6252dec7e873317 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 ICSharpCode.NRefactory.Editor;
  20. using ICSharpCode.AvalonEdit.Document;
  21. namespace ICSharpCode.AvalonEdit.Snippets
  22. {
  23. /// <summary>
  24. /// Represents an active element that allows the snippet to stay interactive after insertion.
  25. /// </summary>
  26. public interface IActiveElement
  27. {
  28. /// <summary>
  29. /// Called when the all snippet elements have been inserted.
  30. /// </summary>
  31. void OnInsertionCompleted();
  32. /// <summary>
  33. /// Called when the interactive mode is deactivated.
  34. /// </summary>
  35. void Deactivate(SnippetEventArgs e);
  36. /// <summary>
  37. /// Gets whether this element is editable (the user will be able to select it with Tab).
  38. /// </summary>
  39. bool IsEditable { get; }
  40. /// <summary>
  41. /// Gets the segment associated with this element. May be null.
  42. /// </summary>
  43. ISegment Segment { get; }
  44. }
  45. }