예제 #1
0
        private void PasteClipboardEntry([CanBeNull] ClipboardEntry item)
        {
            if (item == null)
            {
                return;
            }

            TextChosen?.Invoke(this, new TextChosenEventArgs(null));
            Clipboard.SetText(item.Value);
            _inputter.PasteFromClipboard().Forget();
        }
예제 #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);
        }
예제 #3
0
        public static void paste(ClipboardEntry destination)
        {
            switch (Mode)
            {
            case EngineClipboardMode.Copy:
                copy(destination);
                break;

            case EngineClipboardMode.Cut:
                cut(destination);
                break;
            }
        }
예제 #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;
            }
        }
예제 #5
0
        private void SetItemPinned(ClipboardEntry item)
        {
            if (item.pinned == true)
            {
                item.pinned = false;
            }
            else
            {
                item.pinned = true;
            }

            App.clipRepository.Save(item);

            this.updateListFilter();
        }
예제 #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);
            //}
        }
예제 #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;
            }
        }
예제 #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);
            }
        }
예제 #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);
         }
     }
 }
예제 #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);
             }
         }
     }
 }
예제 #11
0
 public static void remove(ClipboardEntry copyPaste)
 {
     clipboard.Remove(copyPaste);
 }
예제 #12
0
 public static void add(ClipboardEntry copyPaste)
 {
     clipboard.Add(copyPaste);
 }
예제 #13
0
 public void Delete(ClipboardEntry item)
 {
     db.Delete(item);
 }
예제 #14
0
 public void Save(ClipboardEntry item)
 {
     db.Save(item);
 }