IImmutableGlyphRunReference.cs 550 B

12345678910111213141516171819202122232425
  1. using System;
  2. using Avalonia.Platform;
  3. using Avalonia.Utilities;
  4. namespace Avalonia.Media;
  5. public interface IImmutableGlyphRunReference : IDisposable
  6. {
  7. internal IRef<IGlyphRunImpl>? GlyphRun { get; }
  8. }
  9. internal class ImmutableGlyphRunReference : IImmutableGlyphRunReference
  10. {
  11. public ImmutableGlyphRunReference(IRef<IGlyphRunImpl>? glyphRun)
  12. {
  13. GlyphRun = glyphRun;
  14. }
  15. public IRef<IGlyphRunImpl>? GlyphRun { get; private set; }
  16. public void Dispose()
  17. {
  18. GlyphRun?.Dispose();
  19. GlyphRun = null;
  20. }
  21. }