Merge pull request #848 from Garulf/clipboard-api-function

Add Clipboard copy to jsonRPC API
This commit is contained in:
Jeremy Wu 2021-11-30 21:25:34 +11:00 committed by GitHub
commit b134e0e200
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -37,6 +37,12 @@ namespace Flow.Launcher.Plugin
/// <exception cref="FileNotFoundException">Thrown when unable to find the file specified in the command </exception>
/// <exception cref="Win32Exception">Thrown when error occurs during the execution of the command </exception>
void ShellRun(string cmd, string filename = "cmd.exe");
/// <summary>
/// Copy Text to clipboard
/// </summary>
/// <param name="Text">Text to save on clipboard</param>
public void CopyToClipboard(string text);
/// <summary>
/// Save everything, all of Flow Launcher and plugins' data and settings

View file

@ -114,6 +114,11 @@ namespace Flow.Launcher
var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: args, createNoWindow: true);
ShellCommand.Execute(startInfo);
}
public void CopyToClipboard(string text)
{
Clipboard.SetDataObject(text);
}
public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible;
@ -222,4 +227,4 @@ namespace Flow.Launcher
#endregion
}
}
}