private void Reload() { _library.Dispose(); _library = new Library(_path, _fileValidator); _library.Open(); _ops = _library.GetOperationsInterface(); }
/// <summary> /// Get library by name. /// </summary> /// <remarks> /// Get library by name in a workspace. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='libraryName'> /// Library name /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <LibraryResource> GetAsync(this ILibraryOperations operations, string resourceGroupName, string libraryName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, libraryName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public BookInfoControlForm(FormViewMode mode, IWorkspaceStockman workspaceStockman, BookInformation book = null) { viewMode = mode; currentBook = book; libraryManagment = workspaceStockman.LibraryOperations; publishHouseRegister = workspaceStockman.PublishHouseInformationRegister; InitializeComponent(); }
public LibraryContentOperations(ILibraryOperations library, ILibraryView libraryView, IErrorHandler errorHandler, IFileValidator fileValidator, Dispatcher dispatcher, IEventAggregator eventAggregator) { _library = library; _libraryView = libraryView; _errorHandler = errorHandler; _fileValidator = fileValidator; _eventAggregator = eventAggregator; _eventAggregator.AddListener(this); Debug.Assert(_fileValidator != null); Debug.Assert(_errorHandler != null); }
public void SetUp() { _fileValidator = new MockFileValidator(); _folder = new AutoKillFolder("TestLibrary", true); _path = Path.Combine(_folder.Path, "test"); _library = new Library(_path, _fileValidator); _library.Create(); _ops = _library.GetOperationsInterface(); _data = new Byte[100]; var random = new Random(); random.NextBytes(_data); _time = DateTime.Parse("2014-01-04 11:10"); }
/// <summary> /// Get library by name. /// </summary> /// <remarks> /// Get library by name in a workspace. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='libraryName'> /// Library name /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> public static LibraryResource Get(this ILibraryOperations operations, string resourceGroupName, string libraryName, string workspaceName) { return(operations.GetAsync(resourceGroupName, libraryName, workspaceName).GetAwaiter().GetResult()); }
public LibraryView(ITagCache tags, IPathsCache paths, IBinariesCache binaries, Dispatcher dispatcher, ILibraryOperations libraryOps, IErrorHandler errorHandler, IFileValidator fileValidator, IEventAggregator eventAggregator) { _tags = tags; _paths = paths; _binariesCache = binaries; _dispatcher = dispatcher; _eventAggregator = eventAggregator; _sourceNodes = new ObservableCollection <LibraryViewNode>(); _nodeViewer = new PropertyOrderedObservableCollectionViewer <LibraryViewNode>(_dispatcher); _nodeViewer.SetMediator(this); _nodeViewer.Attach(_sourceNodes); _nodeViewer.OrderBy(f => f.Name, new [] { "Name" }, false); _eventAggregator.AddListener(this, _dispatcher); LoadedBinariesCache = new LoadedBinaryCache(100, binaries); Operations = new LibraryContentOperations(libraryOps, this, errorHandler, fileValidator, _dispatcher, _eventAggregator); _dispatcher.BeginInvoke(new Action(PerformLoad)); }