private void PasteClipboardEntry([CanBeNull] ClipboardEntry item) { if (item == null) { return; } TextChosen?.Invoke(this, new TextChosenEventArgs(null)); Clipboard.SetText(item.Value); _inputter.PasteFromClipboard().Forget(); }
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); }
public static void paste(ClipboardEntry destination) { switch (Mode) { case EngineClipboardMode.Copy: copy(destination); break; case EngineClipboardMode.Cut: cut(destination); break; } }
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; } }
private void SetItemPinned(ClipboardEntry item) { if (item.pinned == true) { item.pinned = false; } else { item.pinned = true; } App.clipRepository.Save(item); this.updateListFilter(); }
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); //} }
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; } }
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); } }
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); } } }
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); } } } }
public static void remove(ClipboardEntry copyPaste) { clipboard.Remove(copyPaste); }
public static void add(ClipboardEntry copyPaste) { clipboard.Add(copyPaste); }
public void Delete(ClipboardEntry item) { db.Delete(item); }
public void Save(ClipboardEntry item) { db.Save(item); }