コード例 #1
0
        private static Result <dynamic, ResponseError> ExecuteCreateImportStatementCommand(
            ProviderContext providerContext,
            dynamic[] arguments)
        {
            string importString = arguments[0];
            string bannerString = arguments[1];

            try
            {
                Clipboard.CopyToClipboard(importString);
                Analysis.IgnoreResult(providerContext.ShowMessageAsync(MessageType.Info, bannerString), "Fire and forget");
            }
            catch (Win32Exception e)
            {
                Analysis.IgnoreResult(providerContext.ShowMessageAsync(MessageType.Error, $"Whoops, we couldn't copy import statement to the clipboard. Error: '{e.Message}'"), "Fire and forget");
            }

            return(Result.Success);
        }