public void Execute(CopyDataToClipboardCommand command) { var columns = _columnRepository.GetAll(); var rows = _stateService.GetSelectedRows(); var text = _exporter.Export(columns, rows); _clipboard.SetText(text); }
/// <summary> /// Copies the Hostname of the selected connection (or the Name of /// the selected container) to the given <see cref="IClipboard"/>. /// </summary> /// <param name="clipboard"></param> public void CopyHostnameSelectedNode(IClipboard clipboard) { if (SelectedNode == null) { return; } var textToCopy = SelectedNode.IsContainer ? SelectedNode.Name : SelectedNode.Hostname; if (string.IsNullOrEmpty(textToCopy)) { return; } clipboard.SetText(textToCopy); }
private void SaveResult(string?destinationFolder, string?convertionResult) { logger.LogInformation("Saving result"); if (string.IsNullOrEmpty(convertionResult) || convertionResult.Equals(CouldNotConvertJsonIntoTableMessage, StringComparison.InvariantCultureIgnoreCase)) { logger.LogError("Could not proceed the convertion please check out if the JSON is well formed"); return; } if (!string.IsNullOrEmpty(destinationFolder)) { File.WriteAllText(destinationFolder, convertionResult); return; } clipboard.SetText(convertionResult); }
public void GetBBCode(IOutputDialog iod, IClipboard ic) { iod.ShowDialog(); if (iod.GetDialogResult()) { StringBuilder sb = new StringBuilder(); if (iod.IsResultOutput()) { sb.Append(ActiveIO.GetBBCode(ActiveTournament, false, true)); } if (iod.IsTableOutput()) { sb.Append(ActiveIO.GetBBCode(ActiveTournament, true)); } if (iod.IsPairingOutput()) { sb.Append(ActiveIO.GetBBCode(ActiveTournament, false)); } ic.SetText(sb.ToString()); } }
/// -------------------------------------------------------------------------------- /// <summary> /// Adds text data to the Clipboard in the Text or UnicodeText format, depending on the /// operating system. /// </summary> /// -------------------------------------------------------------------------------- public static void SetText(string text) { s_Clipboard.SetText(text); }
public void SetText(string text) { Check(); clipboard.SetText(text); }
private void CopyNameToClipboard() { clipboard.SetText(Name); }
private void RegisterHierarchyCommands(IVsHierarchyImpl hierarchy) { hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(VSConstants.GUID_VsUIHierarchyWindowCmds, (int)VSConstants.VsUIHierarchyWindowCmdIds.UIHWCMDID_DoubleClick), IsEnabled = node => node is FileNodeViewModel, Execute = args => OpenDocument(args.Hierarchy, args.Node) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(VSConstants.GUID_VsUIHierarchyWindowCmds, (int)VSConstants.VsUIHierarchyWindowCmdIds.UIHWCMDID_EnterKey), IsEnabled = node => node is FileNodeViewModel, Execute = args => OpenDocument(args.Hierarchy, args.Node) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(VSConstants.GUID_VsUIHierarchyWindowCmds, (int)VSConstants.VsUIHierarchyWindowCmdIds.UIHWCMDID_RightClick), IsEnabled = node => true, Execute = args => ShowContextMenu(args.Node, args.VariantIn) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Open), IsEnabled = node => node is FileNodeViewModel, Execute = args => OpenDocument(args.Hierarchy, args.Node) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.OpenWith), IsEnabled = node => node is FileNodeViewModel, Execute = args => OpenDocument(args.Hierarchy, args.Node, openWith: true) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.SLNREFRESH), IsEnabled = node => true, Execute = args => RefreshFileSystemTree() }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidCopyFullPath), IsEnabled = node => node is DirectoryNodeViewModel, Execute = args => _clipboard.SetText(args.Node.FullPathString) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidCopyFullPathPosix), IsEnabled = node => node is DirectoryNodeViewModel, Execute = args => _clipboard.SetText(PathHelpers.ToPosix(args.Node.FullPathString)) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidCopyRelativePath), IsEnabled = node => node is DirectoryNodeViewModel, Execute = args => _clipboard.SetText(args.Node.RelativePath) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidCopyRelativePathPosix), IsEnabled = node => node is DirectoryNodeViewModel, Execute = args => _clipboard.SetText(PathHelpers.ToPosix(args.Node.RelativePath)) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidOpenFolderInExplorer), IsEnabled = node => node is DirectoryNodeViewModel, Execute = args => _windowsExplorer.OpenFolder(args.Node.FullPathString) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidShowProjectIndexDetails), IsEnabled = node => node is DirectoryNodeViewModel, Execute = args => ShowProjectIndexDetails(args.Node.FullPathString) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidShowDirectoryIndexDetails), IsEnabled = node => node is DirectoryNodeViewModel, Execute = args => ShowDirectoryIndexDetails(args.Node.FullPathString) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidCopyFileFullPath), IsEnabled = node => node is FileNodeViewModel, Execute = args => _clipboard.SetText(args.Node.FullPathString) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidCopyFileFullPathPosix), IsEnabled = node => node is FileNodeViewModel, Execute = args => _clipboard.SetText(PathHelpers.ToPosix(args.Node.FullPathString)) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidCopyFileRelativePath), IsEnabled = node => node is FileNodeViewModel, Execute = args => _clipboard.SetText(args.Node.RelativePath) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidCopyFileRelativePathPosix), IsEnabled = node => node is FileNodeViewModel, Execute = args => _clipboard.SetText(PathHelpers.ToPosix(args.Node.RelativePath)) }); hierarchy.AddCommandHandler(new VsHierarchyCommandHandler { CommandId = new CommandID(GuidList.GuidVsChromiumCmdSet, (int)PkgCmdIdList.CmdidOpenContainingFolder), IsEnabled = node => node is FileNodeViewModel, Execute = args => _windowsExplorer.OpenContainingFolder(args.Node.FullPathString) }); }
private void 制字(object sender, EventArgs e) { MyClipboard.SetText(sometext.Text); DisplayAlert("复制字", "复制好啦喵", @"~\(≧▽≦)/~"); }