Exemplo n.º 1
0
        /// <summary>
        /// Tries to copy this clip to the clipboard.
        /// </summary>
        /// <returns>True if clipboard was filled.</returns>
        public bool Copy()
        {
            try
            {
                var args = new ClipboardManager.ClipEventArgs();
                args.Clip = this;

                Copied?.Invoke(this, args);

                System.Windows.Clipboard.SetText(Content);
                return(true);
            }
            catch (System.Runtime.InteropServices.ExternalException e)
            {
                Utility.Logging.Log("Failed to set clipboard: " + e.Message);
                return(false);
            }
        }
Exemplo n.º 2
0
        private void OnClipCaptured(object sender, Clipboard.ClipboardManager.ClipEventArgs e)
        {
            Utility.Logging.Log(
                String.Format(
                    "OnClipCaptured, Content = {0}",
                    System.Windows.Clipboard.GetText()
                    )
                );

            var clip = e.Clip;

            if (clip != null)
            {
                if (clipViewModel.AddClip(clip))
                {
                    (Resources["BlinkTaskBarOverlay"] as Storyboard)?.Begin();
                }
            }
        }
Exemplo n.º 3
0
 private void OnClipCopied(object sender, Clipboard.ClipboardManager.ClipEventArgs e)
 {
     (Resources["StatusBarFlash"] as Storyboard)?.Begin();
 }