private void PasteClipboardEntry([CanBeNull] ClipboardEntry item)
        {
            if (item == null)
            {
                return;
            }

            TextChosen?.Invoke(this, new TextChosenEventArgs(null));
            Clipboard.SetText(item.Value);
            _inputter.PasteFromClipboard().Forget();
        }
Exemple #2
0
        private void Pin_Item_MouseDown(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            ClipboardEntry item = (ClipboardEntry)(sender as FrameworkElement).DataContext;

            int index = this.ListClips.Items.IndexOf(item);

            this.ListClips.SelectedIndex = index;

            SetItemPinned(item);
        }
Exemple #3
0
        public static void paste(ClipboardEntry destination)
        {
            switch (Mode)
            {
            case EngineClipboardMode.Copy:
                copy(destination);
                break;

            case EngineClipboardMode.Cut:
                cut(destination);
                break;
            }
        }
Exemple #4
0
        private void ListClips_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
        {
            ClipboardEntry clip = (ClipboardEntry)this.ListClips.SelectedValue;

            if (clip != null)
            {
                PopupTxt.Text       = clip.clipboardContents;
                ListPopup.IsOpen    = true;
                ListPopup.Placement = System.Windows.Controls.Primitives.PlacementMode.Left;

                ListPopup.PlacementTarget = (UIElement)this.ListClips;
            }
        }
Exemple #5
0
        private void SetItemPinned(ClipboardEntry item)
        {
            if (item.pinned == true)
            {
                item.pinned = false;
            }
            else
            {
                item.pinned = true;
            }

            App.clipRepository.Save(item);

            this.updateListFilter();
        }
Exemple #6
0
        private void setSelectedClip()
        {
            ClipboardEntry clip = (ClipboardEntry)this.ListClips.SelectedValue;

            if (clip != null)
            {
                clip.setToClipboard();

                this.Hide();
            }
            //if (App.main != null)
            //{
            //TODO Make this an option to automatically paste, make it a context menu would be a good option too
            //    User32.SetActiveWindow(App.main);
            //    InputSimulator.SimulateModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V);
            //}
        }
Exemple #7
0
        private void Show_Context_ForClipMouseDown(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            ClipboardEntry item = (ClipboardEntry)(sender as FrameworkElement).DataContext;

            int index = this.ListClips.Items.IndexOf(item);

            this.ListClips.SelectedIndex = index;

            ListView clip = (ListView)this.ListClips;

            if (clip != null)
            {
                clip.ContextMenu.PlacementTarget = button;
                clip.ContextMenu.Placement       = System.Windows.Controls.Primitives.PlacementMode.Right;
                clip.ContextMenu.IsOpen          = true;
            }
        }
Exemple #8
0
        public void Insert(ClipboardEntry item)
        {
            //check to see if already exist, if so, just update time then save.
            ClipboardEntry oldItem = db.Where <ClipboardEntry>(a => a.clipboardContents == item.clipboardContents).ToList().FirstOrDefault();

            if (oldItem != null)
            {
                oldItem.dateClipped = item.dateClipped;
                db.Save(oldItem);
            }
            else
            {
                db.Save(item);
            }

            if (Properties.Settings.Default.authKey != null)
            {
                App.clipRemoteProxy.Invoke("clientClipped", Properties.Settings.Default.authKey, item.clipboardContents, item.applicationClippedFrom);
            }
        }
Exemple #9
0
 private static void copy(ClipboardEntry destination)
 {
     foreach (ClipboardEntry copyPaste in clipboard)
     {
         if (copyPaste.SupportsCopy)
         {
             if (destination.supportsPastingType(copyPaste.ObjectType))
             {
                 destination.paste(copyPaste.copy());
             }
             else
             {
                 Log.ImportantInfo("Type {0} cannot be pasted into {1}.", copyPaste.ObjectType.Name, destination.ObjectType.Name);
             }
         }
         else
         {
             Log.ImportantInfo("Type {0} does not support copy.", copyPaste.ObjectType.Name);
         }
     }
 }
Exemple #10
0
 public void paste()
 {
     if (solutionWindow.Active)
     {
         EditInterface  selectedInterface = solutionController.CurrentEditInterface;
         ClipboardEntry clipEntry         = selectedInterface.ClipboardEntry;
         if (selectedInterface.SupportsClipboard && clipEntry.SupportsPaste)
         {
             EngineClipboard.paste(clipEntry);
         }
     }
     else if (propertiesEditor.Active)
     {
         EditInterface selectedInterface = propertiesEditor.SelectedEditInterface;
         if (selectedInterface.SupportsClipboard)
         {
             ClipboardEntry clipEntry = selectedInterface.ClipboardEntry;
             if (clipEntry.SupportsPaste)
             {
                 EngineClipboard.paste(clipEntry);
             }
         }
     }
 }
Exemple #11
0
 public static void remove(ClipboardEntry copyPaste)
 {
     clipboard.Remove(copyPaste);
 }
Exemple #12
0
 public static void add(ClipboardEntry copyPaste)
 {
     clipboard.Add(copyPaste);
 }
Exemple #13
0
 public void Delete(ClipboardEntry item)
 {
     db.Delete(item);
 }
Exemple #14
0
 public void Save(ClipboardEntry item)
 {
     db.Save(item);
 }