public void SetNextElement() { if (ExtendedClipboard.Count > 0 && !_clipboardEventsHandler.CanChangePositionOfSelectedItem() && _timer.ElapsedMilliseconds >= _generalSettingsModel.TimeToElapse) { if (++_clipboardIndex >= ExtendedClipboard.Count) { _clipboardIndex = 0; } ClipboardDisplayer.SetNextElement(_clipboardIndex); _clipboardEventsHandler.SetChangePositionOfSelectedItem(true); } }
private async void WaitForDisplayExtendedClipboard() { await Task.Run(() => { lock (_timer) { while (_timer.ElapsedMilliseconds < _generalSettingsModel.TimeToElapse) { ; } } }); if (!IsPastingStarted()) { return; } _clipboardEventsHandler.SetSelectingFromClipboard(true); _clipboardEventsHandler.SetChangePositionOfSelectedItem(true); ClipboardDisplayer.DisplayClipboard(); }
public void PasteStop() { if (!IsPastingStarted() || ExtendedClipboard.Count == 0) { return; } _timer.Reset(); UnregisterAll(); IClipboardData currentElement = null; if (_clipboardIndex >= 0) { currentElement = ExtendedClipboard.ElementAt(_clipboardIndex); if (!ExtendedClipboard.ElementAt(_clipboardIndex).IsLinkOrLinks()) { Clipboard.SetText((string)currentElement.GetData()); } else { Clipboard.SetDataObject(currentElement.GetData()); } } _inputSimulator.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V); RegisterAll(); ClipboardDisplayer.CloseClipboard(); ClipboardDisplayer.ClearBackground(); if (currentElement != null) { ExtendedClipboard.Remove(currentElement); ExtendedClipboard.AddFirst(currentElement); } _clipboardIndex = 0; }
public void CloseClipboardView() { ClipboardDisplayer.Close(); }