public SelectRootDirectoryViewModel(IIoC ioc, IRootDirectoryFacade rootDirectory) : base(ioc)
        {
            if (rootDirectory == null) throw new ArgumentNullException(nameof(rootDirectory));
            _rootDirectory = rootDirectory;

            MessageBus.Subscribe<RootDirectoryChanged>(OnRootDirectoryChanged);
        }
Esempio n. 2
0
        public MainViewModel(IIoC ioc, 
            ISelectRootDirectoryViewModel selectRootDirectoryViewModel,
            IListNotebooksViewModel listNotebooksViewModel,
            IListSectionsViewModel listSectionsViewModel,
            IListPagesViewModel listPagesViewModel,
            IEditorViewModel editorViewModel,
            IAddNotebookViewModel addNotebookViewModel,
            IAddSectionViewModel addSectionViewModel,
            IAddPageViewModel addPageViewModel,
            IRootDirectoryFacade rootDirectory,
            IImageCarouselViewModel imageCarousel
            ) : base(ioc)
        {
            if (selectRootDirectoryViewModel == null)
                throw new ArgumentNullException(nameof(selectRootDirectoryViewModel));

            if (listNotebooksViewModel == null)
                throw new ArgumentNullException(nameof(listNotebooksViewModel));

            if (listSectionsViewModel == null)
                throw new ArgumentNullException(nameof(listSectionsViewModel));

            if (listPagesViewModel == null)
                throw new ArgumentNullException(nameof(listPagesViewModel));

            if (editorViewModel == null)
                throw new ArgumentNullException(nameof(editorViewModel));

            if (addNotebookViewModel == null)
                throw new ArgumentNullException(nameof(addNotebookViewModel));

            if (addSectionViewModel == null)
                throw new ArgumentNullException(nameof(addSectionViewModel));

            if (addPageViewModel == null)
                throw new ArgumentNullException(nameof(addPageViewModel));

            if (rootDirectory == null)
                throw new ArgumentNullException(nameof(rootDirectory));

            if (imageCarousel == null)
                throw new ArgumentNullException(nameof(imageCarousel));

            _rootDirectory = rootDirectory;
            
            SelectRootDirectory = selectRootDirectoryViewModel;
            ListNotebooks = listNotebooksViewModel;
            ListSections = listSectionsViewModel;
            ListPages = listPagesViewModel;
            Editor = editorViewModel;
            AddNotebook = addNotebookViewModel;
            AddSection = addSectionViewModel;
            AddPage = addPageViewModel;
            ImageCarousel = imageCarousel;

            MessageBus.Subscribe<RootDirectoryChanged>(OnNewRootDirectory);
            MessageBus.Subscribe<NotebookSelected>(OnNotebookSelected);
            MessageBus.Subscribe<SectionSelected>(OnSectionSelected);
        }
Esempio n. 3
0
 public AddNotebookViewModel(INotebookFacade notebook, IRootDirectoryFacade rootDirectory, IIoC ioc) : base(ioc)
 {
     if (notebook == null)
     {
         throw new ArgumentNullException(nameof(notebook));
     }
     _notebook      = notebook;
     _rootDirectory = rootDirectory;
 }
Esempio n. 4
0
        public SelectRootDirectoryViewModel(IIoC ioc, IRootDirectoryFacade rootDirectory) : base(ioc)
        {
            if (rootDirectory == null)
            {
                throw new ArgumentNullException(nameof(rootDirectory));
            }
            _rootDirectory = rootDirectory;

            MessageBus.Subscribe <RootDirectoryChanged>(OnRootDirectoryChanged);
        }
Esempio n. 5
0
        public NotebookActor(ISectionFacade section, IRootDirectoryFacade rootDirectory, ILogger logger)
            : base(logger)
        {
            if (section == null) throw new ArgumentNullException(nameof(section));
            if (rootDirectory == null) throw new ArgumentNullException(nameof(rootDirectory));

            _section = section;
            _rootDirectory = rootDirectory;

            Receive<CreateNotebook>(msg => OnCreateNotebook(msg));
            Receive<GetNotebooks>(msg =>
            {
                var originalSender = Sender;
                OnGetNotebooks(msg, originalSender);
            });

            Receive<Internal.GotCurrentRootDirectoryResult>(msg => OnGotCurrentRootDirectoryResult(msg));
            Receive<Internal.SetNotebookSectionsResult>(msg => OnSectionsHasBeenSetOnNotebooks(msg));
        }
Esempio n. 6
0
        public NotebookActor(ISectionFacade section, IRootDirectoryFacade rootDirectory, ILogger logger) : base(logger)
        {
            if (section == null)
            {
                throw new ArgumentNullException(nameof(section));
            }
            if (rootDirectory == null)
            {
                throw new ArgumentNullException(nameof(rootDirectory));
            }

            _section       = section;
            _rootDirectory = rootDirectory;

            Receive <CreateNotebook>(msg => OnCreateNotebook(msg));
            Receive <GetNotebooks>(msg =>
            {
                var originalSender = Sender;
                OnGetNotebooks(msg, originalSender);
            });

            Receive <Internal.GotCurrentRootDirectoryResult>(msg => OnGotCurrentRootDirectoryResult(msg));
            Receive <Internal.SetNotebookSectionsResult>(msg => OnSectionsHasBeenSetOnNotebooks(msg));
        }
Esempio n. 7
0
 public AddNotebookViewModel(INotebookFacade notebook, IRootDirectoryFacade rootDirectory, IIoC ioc) : base(ioc)
 {
     if (notebook == null) throw new ArgumentNullException(nameof(notebook));
     _notebook = notebook;
     _rootDirectory = rootDirectory;
 }