/// <summary>
        /// Initializes a new instance of the <see cref="LibraryViewPresentationModel"/> class.
        /// </summary>
        /// <param name="view">The <see cref="ILibraryView"/>.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="regionManager">The region manager.</param>
        /// <param name="configurationService">The configuration service.</param>
        /// <param name="errorViewResolver">The error view resolver.</param>
        public LibraryViewPresentationModel(ILibraryView view, IEventAggregator eventAggregator, IRegionManager regionManager, IConfigurationService configurationService, Func <IErrorView> errorViewResolver)
        {
            this.eventAggregator      = eventAggregator;
            this.View                 = view;
            this.regionManager        = regionManager;
            this.configurationService = configurationService;
            this.errorViewResolver    = errorViewResolver;

            this.addItemCommand           = new DelegateCommand <object>(this.AddToMediaBin);
            this.shiftSliderScaleCommand  = new DelegateCommand <string>(this.ShiftScale, this.CanShiftScale);
            this.parentFolderCommand      = new DelegateCommand <string>(this.ShowParentFolders, this.CanShowParentFolder);
            this.helpViewCommand          = new DelegateCommand <string>(this.ShowHelpView);
            this.playSelectedAssetCommand = new DelegateCommand <object>(this.PlaySelectedAsset);

            this.assets        = new List <Asset>();
            this.currentAssets = new List <Asset>();

            // Todo: Get this value from the config file.
            this.Scale      = 0.2;
            this.ShowImages = true;
            this.ShowVideos = true;
            this.ShowAudio  = true;

            this.PropertyChanged += this.LibraryViewPresentationModel_PropertyChanged;

            this.eventAggregator.GetEvent <AssetsAvailableEvent>().Subscribe(this.OnAssetsAvailable, true);

            this.View.ShowProgressBar();

            // Add metadata fields.
            this.View.AddMetadataFields(this.configurationService.GetMetadataFields());
            this.View.Model = this;
        }
예제 #2
0
 public LibraryController(ILibraryView view)
 {
     this.state = InnerState.INITIAL;
     binding = new WS2007HttpBinding(new HttpTransportBindingConfig(new Uri("http://" + IP_ADDRESS + "/LibraryWS/Service.svc")));
     View = view;
     View.Controller = this;
     View.ShowLoginPage();
 }
예제 #3
0
 public void CloseLibrary(ILibraryView library)
 {
     lock (_lock)
     {
         if (_current != null)
         {
             _current.Dispose();
             _current = null;
         }
     }
 }
예제 #4
0
        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);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LibraryViewPresentationModel"/> class.
        /// </summary>
        /// <param name="view">The <see cref="ILibraryView"/>.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="regionManager">The region manager.</param>
        /// <param name="configurationService">The configuration service.</param>
        /// <param name="errorViewResolver">The error view resolver.</param>
        public LibraryViewPresentationModel(ILibraryView view, IEventAggregator eventAggregator, IRegionManager regionManager, IConfigurationService configurationService, Func <IErrorView> errorViewResolver)
        {
            this.eventAggregator      = eventAggregator;
            this.View                 = view;
            this.regionManager        = regionManager;
            this.configurationService = configurationService;
            this.errorViewResolver    = errorViewResolver;

            this.addItemCommand           = new DelegateCommand <object>(this.AddToMediaBin);
            this.parentFolderCommand      = new DelegateCommand <string>(this.ShowParentFolders, this.CanShowParentFolder);
            this.helpViewCommand          = new DelegateCommand <string>(this.ShowHelpView);
            this.playSelectedAssetCommand = new DelegateCommand <object>(this.PlaySelectedAsset);
            this.KeyboardActionCommand    = new DelegateCommand <Tuple <KeyboardAction, object> >(this.ExecuteKeyboardAction);

            this.assets        = new List <Asset>();
            this.currentAssets = new List <Asset>();

            // Todo: Get this value from the config file.
            this.Scale      = 0.2;
            this.ShowImages = true;
            this.ShowVideos = true;
            this.ShowAudio  = true;

            this.PropertyChanged += this.LibraryViewPresentationModel_PropertyChanged;

            this.eventAggregator.GetEvent <AssetsLoadingEvent>().Subscribe(this.OnAssetsLoading, true);
            this.eventAggregator.GetEvent <AssetsAvailableEvent>().Subscribe(this.OnAssetsAvailable, true);
            this.eventAggregator.GetEvent <ResetWindowsEvent>().Subscribe(this.ResetWindow);

            // Add metadata fields.
            this.View.AddMetadataFields(this.configurationService.GetMetadataFields());
            this.View.Model = this;

            this.SearchIntegrationEnabled = this.configurationService.GetParameterValueAsBoolean("SearchIntegrationEnabled").GetValueOrDefault();

            if (!this.SearchIntegrationEnabled)
            {
                this.View.ShowProgressBar();
            }
        }
예제 #6
0
 public void CloseLibrary(ILibraryView library)
 {
     _sb.AppendLine(string.Format("Close library in location \"{0}\".", ((MockLibraryView)library).Path));
 }
예제 #7
0
파일: MainVm.cs 프로젝트: PSL-Practice/Imb
 private void CreateNewDisplayView(ILibraryView lib)
 {
     DisplayView = new DisplayVm(lib.LoadedBinariesCache);
     lib.AttachDisplay(DisplayView);
 }
예제 #8
0
 public void SetLibrary(ILibraryView libraryView)
 {
     _library = libraryView;
 }