mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
47 lines
1.7 KiB
C#
47 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows;
|
|
using Flow.Launcher.Plugin;
|
|
using Flow.Launcher.Plugin.WindowsSettings.Classes;
|
|
using Flow.Launcher.Plugin.WindowsSettings.Properties;
|
|
|
|
namespace Flow.Launcher.Plugin.WindowsSettings.Helper
|
|
{
|
|
/// <summary>
|
|
/// Helper class to easier work with context menu entries
|
|
/// </summary>
|
|
internal static class ContextMenuHelper
|
|
{
|
|
/// <summary>
|
|
/// Return a list with all context menu entries for the given <see cref="Result"/>
|
|
/// <para>Symbols taken from <see href="https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font"/></para>
|
|
/// </summary>
|
|
/// <param name="result">The result for the context menu entires</param>
|
|
/// <param name="assemblyName">The name of the this assembly</param>
|
|
/// <returns>A list with context menu entries</returns>
|
|
internal static List<Result> GetContextMenu(in Result result, in string assemblyName)
|
|
{
|
|
return new List<Result>(0);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Copy the given text to the clipboard
|
|
/// </summary>
|
|
/// <param name="text">The text to copy to the clipboard</param>
|
|
/// <returns><see langword="true"/>The text successful copy to the clipboard, otherwise <see langword="false"/></returns>
|
|
private static bool TryToCopyToClipBoard(in string text)
|
|
{
|
|
try
|
|
{
|
|
Clipboard.Clear();
|
|
Clipboard.SetText(text);
|
|
return true;
|
|
}
|
|
catch (Exception exception)
|
|
{
|
|
Log.Exception("Can't copy to clipboard", exception, typeof(Main));
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|