IDataObject.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections.Generic;
  2. namespace Avalonia.Input
  3. {
  4. /// <summary>
  5. /// Interface to access information about the data of a drag-and-drop operation.
  6. /// </summary>
  7. public interface IDataObject
  8. {
  9. /// <summary>
  10. /// Lists all formats which are present in the DataObject.
  11. /// <seealso cref="DataFormats"/>
  12. /// </summary>
  13. IEnumerable<string> GetDataFormats();
  14. /// <summary>
  15. /// Checks wether a given DataFormat is present in this object
  16. /// <seealso cref="DataFormats"/>
  17. /// </summary>
  18. bool Contains(string dataFormat);
  19. /// <summary>
  20. /// Returns the dragged text if the DataObject contains any text.
  21. /// <seealso cref="DataFormats.Text"/>
  22. /// </summary>
  23. string GetText();
  24. /// <summary>
  25. /// Returns a list of filenames if the DataObject contains filenames.
  26. /// <seealso cref="DataFormats.FileNames"/>
  27. /// </summary>
  28. IEnumerable<string> GetFileNames();
  29. /// <summary>
  30. /// Tries to get the data of the given DataFormat.
  31. /// </summary>
  32. object Get(string dataFormat);
  33. }
  34. }