public LinkedTextContentFactoriesManager(IEnumerable <ILinkedTextContentFactory> factories, IClipboardObjectManager clipboardObjectManager) { this.clipboardObjectManager = clipboardObjectManager; this.factories = new List <ILinkedTextContentFactory>(factories); foreach (var f in this.factories.Where(f => !f.Regexes.All(r => r.Options.HasFlag(RegexOptions.Compiled)))) { throw new InvalidOperationException($"{nameof(ILinkedTextContentFactory)} of type {f.GetType().Name} must have all {nameof(ILinkedTextContentFactory.Regexes)} with flag {nameof(RegexOptions)}.{nameof(RegexOptions.Compiled)} set to ensure performance"); } }
public PinnedManager(IClipboardFormatsManager formatsManager, IClipboardObjectsManager clipboardObjectsManager, IClipboardObjectManager clipboardObjectManager, IAppDataManager appDataManager) { if (pinnedTriggerType == null) { pinnedTriggerType = new CustomClipboardTriggerType("Pinned", "PinIcon"); } this.formatsManager = formatsManager; this.clipboardObjectsManager = clipboardObjectsManager; this.clipboardObjectManager = clipboardObjectManager; directory = appDataManager.RoamingPath + "Pins"; }
public ClipboardObjectsManager(IClipboardObjectManager objectManager, IEnumerable <IFormatsExtractor> formatsExtractors, IEnumerable <IClipboardFilter> clipboardFilters, IServiceProvider serviceProvider) { _objectManager = objectManager; this.formatsExtractors = formatsExtractors; this.clipboardFilters = clipboardFilters; _allCollection = new KeyedCollectionFunc <Guid, ClipboardObject>(co => co.Id, new ConcurrentDictionary <Guid, ClipboardObject>()); _linkedCollection = new ConcurrentDictionary <ClipboardObject, List <ClipboardObject> >(); _listeners = new List <IClipboardObjectsListener>(); clipboardCloner = serviceProvider.Create <ClipboardClonerThread>(this); clipboardTriggerScheduler = serviceProvider.Create <ClipboardTriggerScheduler>(clipboardCloner); }