Ejemplo n.º 1
0
        private async Task Export()
        {
            var exportContent = await Task.Run(() => _brainstormingService.GetExport());

            _clipboardService.CopyToClipboard(exportContent);
            _toastMessageService.LongAlert(AppResources.CopiedToClipboardMessage);
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 4
0
        /// <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 [^>]+>|<[^>]+>|\\&lt;|\\&gt;|\\&nbsp;|\\&quot;)", rg =>
            {
                // Форматирование
                switch (rg.Groups[0].Value)
                {
                case "&quot;": return("\"");

                case "&lt;": return("<");

                case "&gt;": 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);
        }
Ejemplo n.º 6
0
 private void CopyAddressCommandExecute()
 {
     clipboardService.CopyToClipboard(ReceivingAddress);
     notificationService.ShowInfo("Address copied to clipboard");
 }