private async Task Export() { var exportContent = await Task.Run(() => _brainstormingService.GetExport()); _clipboardService.CopyToClipboard(exportContent); _toastMessageService.LongAlert(AppResources.CopiedToClipboardMessage); }
private void OnCopyToClipboardExecute() { var sb = new StringBuilder(); foreach (var item in SystemInfo) { sb.AppendFormat("{0} {1} {2}", item.Key, item.Value, Environment.NewLine); } _clipboardService.CopyToClipboard(sb.ToString()); }
protected override void Execute(object parameter) { var stringBuilder = new StringBuilder(); foreach (var record in _logTableService.LogTable.Records) { stringBuilder.AppendLine(record.ToString()); } _clipboardService.CopyToClipboard(stringBuilder.ToString()); }
/// <summary> /// Копировать текст в буфер обмена /// </summary> private void MenuItem_ClipboardClicked(object sender, EventArgs e) { MenuItem item = sender as MenuItem; string text = item.BindingContext as string; if (text == null) { return; } text = Regex.Replace(text, "(<br />|<[^<]+>|<img [^>]+>|<[^>]+>|\\<|\\>|\\ |\\")", rg => { // Форматирование switch (rg.Groups[0].Value) { case """: return("\""); case "<": return("<"); case ">": return(">"); case "</p>": case "</li>": case "</code>": case "<hr>": case "<br>": case "<br />": return("\n"); } // Текста в <h*>*</h*> if (Regex.IsMatch(rg.Groups[0].Value, "</h[0-9]+>")) { return("\n"); } // Изображение if (rg.Groups[0].Value.Contains("src=")) { return(new Regex("src=\"([^\"]+)\"").Match(rg.Groups[0].Value).Groups[1].Value); } // Удаляем return(""); }); IClipboardService Clipboard = DependencyService.Get <IClipboardService>(); Clipboard.CopyToClipboard(text); }
private void OnCopyToClipboardExecute() { var text = _messageService.GetAsText(Message, Button); _clipboardService.CopyToClipboard(text); }
private void CopyAddressCommandExecute() { clipboardService.CopyToClipboard(ReceivingAddress); notificationService.ShowInfo("Address copied to clipboard"); }