Fix xmldoc and param name

This commit is contained in:
Susko3
2023-07-10 19:07:26 +02:00
parent d4cc29ed17
commit 7a17bb29a3
4 changed files with 10 additions and 16 deletions

View File

@@ -12,31 +12,25 @@ namespace osu.Framework.Platform
public abstract class Clipboard
{
/// <summary>
/// Retrieve text from the clipboard
/// Retrieve text from the clipboard.
/// </summary>
public abstract string? GetText();
/// <summary>
/// Copy text to the clipboard
/// Copy text to the clipboard.
/// </summary>
/// <param name="selectedText">Text to copy to the clipboard</param>
public abstract void SetText(string selectedText);
/// <param name="text">Text to copy to the clipboard</param>
public abstract void SetText(string text);
/// <summary>
/// Retrieve image from the clipboard.
/// Retrieve an image from the clipboard.
/// </summary>
/// <remarks>
/// Currently only supported on Windows.
/// </remarks>
public abstract Image<TPixel>? GetImage<TPixel>()
where TPixel : unmanaged, IPixel<TPixel>;
/// <summary>
/// Copy the image to the clipboard.
/// </summary>
/// <remarks>
/// Currently only supported on Windows.
/// </remarks>
/// <param name="image">The image to copy to the clipboard</param>
/// <returns>Whether the image was successfully copied or not</returns>
public abstract bool SetImage(Image image);

View File

@@ -15,7 +15,7 @@ namespace osu.Framework.Platform.MacOS
public override Image<TPixel>? GetImage<TPixel>() => Cocoa.FromNSImage<TPixel>(getFromPasteboard(Class.Get("NSImage")));
public override void SetText(string selectedText) => setToPasteboard(Cocoa.ToNSString(selectedText));
public override void SetText(string text) => setToPasteboard(Cocoa.ToNSString(text));
public override bool SetImage(Image image) => setToPasteboard(Cocoa.ToNSImage(image));

View File

@@ -10,7 +10,7 @@ namespace osu.Framework.Platform.SDL2
{
public override string? GetText() => SDL.SDL_GetClipboardText();
public override void SetText(string selectedText) => SDL.SDL_SetClipboardText(selectedText);
public override void SetText(string text) => SDL.SDL_SetClipboardText(text);
public override Image<TPixel>? GetImage<TPixel>()
{

View File

@@ -69,10 +69,10 @@ namespace osu.Framework.Platform.Windows
return getClipboard(cf_unicodetext, bytes => Encoding.Unicode.GetString(bytes).TrimEnd('\0'));
}
public override void SetText(string selectedText)
public override void SetText(string text)
{
int bytes = (selectedText.Length + 1) * 2;
var source = Marshal.StringToHGlobalUni(selectedText);
int bytes = (text.Length + 1) * 2;
var source = Marshal.StringToHGlobalUni(text);
setClipboard(source, bytes, cf_unicodetext);
}