Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public interface IPublicAPI
/// <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
Expand Down
7 changes: 6 additions & 1 deletion Flow.Launcher/PublicAPIInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ public void ShellRun(string cmd, string filename = "cmd.exe")
var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: args, createNoWindow: true);
ShellCommand.Execute(startInfo);
}

public void CopyToClipboard(string text)
{
Clipboard.SetText(text);
}

public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible;

Expand Down Expand Up @@ -222,4 +227,4 @@ private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, Spe

#endregion
}
}
}