public static IPersistentBufersStorage CreateStorageByFileExtension(this IBufersStorageFactory factory, string filePath) { var storageType = filePath.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) ? BufersStorageType.JsonFile : filePath.EndsWith("txt", StringComparison.InvariantCultureIgnoreCase) ? BufersStorageType.TxtFile : throw new NotSupportedException("File format is not supported"); return(factory.Create(storageType, filePath)); }
public UserFileStorageSelector(IBufersStorageFactory bufersStorageFactory) { this._bufersStorageFactory = bufersStorageFactory; this._dialog.Filter = Resource.LoadFileFilter; this._dialog.CheckFileExists = true; this._dialog.CheckPathExists = true; this._dialog.RestoreDirectory = true; this._dialog.Multiselect = false; }
public SessionManager( IClipboardBuferService clipboardBuferService, IProgramSettingsGetter settings, IBufersStorageFactory bufersStorageFactory, IFileStorage fileStorage, ITime time) { this._clipboardBuferService = clipboardBuferService; this._settings = settings; this._bufersStorageFactory = bufersStorageFactory; this._fileStorage = fileStorage; this._time = time; }
public BuferContextMenuGenerator(IBuferSelectionHandlerFactory buferSelectionHandlerFactory, IProgramSettingsGetter settings, IClipboardWrapper clipboardWrapper, IBufersStorageFactory bufersStorageFactory, IUserFileSelector userFileSelector, IFileStorage fileStorage) { this._buferSelectionHandlerFactory = buferSelectionHandlerFactory; this._settings = settings; this._clipboardWrapper = clipboardWrapper; this._bufersStorageFactory = bufersStorageFactory; this._userFileSelector = userFileSelector; this._fileStorage = fileStorage; }
public BufermanApplication(IClipboardBuferService clipboardBuferService, IClipboardWrapper clipboardWrapper, IIDataObjectHandler dataObjectHandler, IProgramSettingsGetter settings, IMainMenuGenerator mainMenuGenerator, IEnumerable <IBufermanPlugin> plugins, IBufersStorageFactory bufersStorageFactory, IBufermanOptionsWindowFactory optionsWindowFactory, IFileStorage fileStorage, ITime time, ISessionManager sessionManager) { this._clipboardBuferService = clipboardBuferService; this._clipboardWrapper = clipboardWrapper; this._plugins = plugins; this._mainMenuGenerator = mainMenuGenerator; this._dataObjectHandler = dataObjectHandler; this._bufersStorageFactory = bufersStorageFactory; this._settings = settings; this._optionsWindowFactory = optionsWindowFactory; this._fileStorage = fileStorage; this._time = time; this._sessionManager = sessionManager; }