Esempio n. 1
0
 private void Reload()
 {
     _library.Dispose();
     _library = new Library(_path, _fileValidator);
     _library.Open();
     _ops = _library.GetOperationsInterface();
 }
Esempio n. 2
0
 /// <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);
     }
 }
Esempio n. 3
0
        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);
        }
Esempio n. 5
0
        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");
        }
Esempio n. 6
0
 /// <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());
 }
Esempio n. 7
0
        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));
        }