Inheritance: IDisposable
Example #1
0
        //autofac uses this
        public EditingModel(BookSelection bookSelection, PageSelection pageSelection,
			LanguageSettings languageSettings,
			TemplateInsertionCommand templateInsertionCommand,
			PageListChangedEvent pageListChangedEvent,
			RelocatePageEvent relocatePageEvent,
			BookRefreshEvent bookRefreshEvent,
			DeletePageCommand deletePageCommand,
			SelectedTabChangedEvent selectedTabChangedEvent,
			SelectedTabAboutToChangeEvent selectedTabAboutToChangeEvent,
			LibraryClosing libraryClosingEvent,
			CollectionSettings collectionSettings,
			SendReceiver sendReceiver)
        {
            _bookSelection = bookSelection;
            _pageSelection = pageSelection;
            _languageSettings = languageSettings;
            _deletePageCommand = deletePageCommand;
            _collectionSettings = collectionSettings;
            _sendReceiver = sendReceiver;

            bookSelection.SelectionChanged += new EventHandler(OnBookSelectionChanged);
            pageSelection.SelectionChanged += new EventHandler(OnPageSelectionChanged);
            templateInsertionCommand.InsertPage += new EventHandler(OnInsertTemplatePage);

            bookRefreshEvent.Subscribe((book) => OnBookSelectionChanged(null, null));
            selectedTabChangedEvent.Subscribe(OnTabChanged);
            selectedTabAboutToChangeEvent.Subscribe(OnTabAboutToChange);
            deletePageCommand.Implementer=OnDeletePage;
            pageListChangedEvent.Subscribe(x => _view.UpdatePageList(false));
            relocatePageEvent.Subscribe(OnRelocatePage);
            libraryClosingEvent.Subscribe(o=>SaveNow());
            _contentLanguages = new List<ContentLanguage>();
        }
Example #2
0
        public LibraryModel(string pathToLibrary, CollectionSettings collectionSettings,
			SendReceiver sendReceiver,
			BookSelection bookSelection,
			SourceCollectionsList sourceCollectionsList,
			BookCollection.Factory bookCollectionFactory,
			EditBookCommand editBookCommand,
			CreateFromSourceBookCommand createFromSourceBookCommand,
			BookServer bookServer,
			CurrentEditableCollectionSelection currentEditableCollectionSelection)
        {
            _bookSelection = bookSelection;
            _pathToLibrary = pathToLibrary;
            _collectionSettings = collectionSettings;
            _sendReceiver = sendReceiver;
            _sourceCollectionsList = sourceCollectionsList;
            _bookCollectionFactory = bookCollectionFactory;
            _editBookCommand = editBookCommand;
            _bookServer = bookServer;
            _currentEditableCollectionSelection = currentEditableCollectionSelection;

            createFromSourceBookCommand.Subscribe(CreateFromSourceBook);
        }
Example #3
0
        //autofac uses this
        public LibraryBookView(BookSelection bookSelection,
			SendReceiver sendReceiver,
			CreateFromSourceBookCommand createFromSourceBookCommand,
			EditBookCommand editBookCommand,
			SelectedTabChangedEvent selectedTabChangedEvent)
        {
            InitializeComponent();
            _bookSelection = bookSelection;
            _sendReceiver = sendReceiver;
            _createFromSourceBookCommand = createFromSourceBookCommand;
            _editBookCommand = editBookCommand;
            bookSelection.SelectionChanged += new EventHandler(OnBookSelectionChanged);

            selectedTabChangedEvent.Subscribe(c =>
                                                {
                                                    _visible = c.To is LibraryView;
                                                    if(_reshowPending)
                                                    {
                                                        ShowBook();
                                                    }
                                                });
            _editBookButton.Visible = false;
        }