Esempio n. 1
0
        /// <summary>
        /// 画面遷移してきたときの処理
        /// </summary>
        /// <param name="e"></param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            this.AddHandler(UIElement.PointerReleasedEvent, new PointerEventHandler(mainGrid_PointerReleased), true);

            ImageNavigateParameter param = e.Parameter as ImageNavigateParameter;

            if (param == null)
            {
                return;
            }

            IImageFileReader reader = null;

            if (param.Type == ImageNavigateParameter.DataType.ImageFile ||
                param.Type == ImageNavigateParameter.DataType.Folder)
            {
                reader = new FolderImageFileReader(param);
            }
            else if (param.Type == ImageNavigateParameter.DataType.Archive)
            {
                reader = new ZipImageFileReader(param);
            }
            else
            {
                return;
            }
            await this.ViewModel.Init(reader, m_db);

            initBookCategory();
            initScrapbookCategory();
            setFirstImage();
        }
Esempio n. 2
0
        public AddBookPresenter(IBookService bookService, ITagService tagService, IAuthorService authorService, IPublisherService publisherService,
                                IAddBookForm view,
                                IImageFileReader imageFileReader)
        {
            this._bookService      = bookService;
            this._tagService       = tagService;
            this._authorService    = authorService;
            this._publisherService = publisherService;

            this._view = view;

            this._imageFileReader = imageFileReader;

            this._allTags       = new Dictionary <string, bool>();
            this._allAuthors    = new Dictionary <string, bool>();
            this._allPublishers = new List <string>();

            // subscribe to the view's events
            this._view.SaveButtonClicked += (async(sender, args) =>
            {
                await HandleSaveButtonClicked(sender, args);
            });
            this._view.InputFieldsUpdated           += InputFieldsUpdated;
            this._view.FilterTagsFieldUpdated       += FilterTags;
            this._view.FilterAuthorsFieldUpdated    += FilterAuthors;
            this._view.FilterPublishersFieldUpdated += FilterPublishers;
            this._view.AddNewTagButtonClicked       += HandleAddNewTagClicked;
            this._view.AddNewAuthorButtonClicked    += HandleAddNewAuthorClicked;
            this._view.AddNewPublisherButtonClicked += HandleAddNewPublisherClicked;
            this._view.TagCheckedChanged            += HandleTagCheckedChanged;
            this._view.AuthorCheckedChanged         += HandleAuthorCheckedChanged;
        }
Esempio n. 3
0
        /// <summary>
        /// 初期化
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="db"></param>
        public async Task Init(IImageFileReader reader, LocalDatabase db)
        {
            await reader.LoadDataAsync();

            m_reader = reader;
            m_db     = db;

            this.Title = m_reader.ParentStorage.Name;
            initDataList();
            initBookmark();
        }
Esempio n. 4
0
 /// <summary>
 /// 画像読み込みImageDataにセットする
 /// </summary>
 /// <param name="reader"></param>
 /// <param name="index"></param>
 public async void SetImage(IImageFileReader reader, int index)
 {
     using (await m_asyncLock.LockAsync())
     {
         if (this.ImageData != null)
         {
             return;
         }
         Debug.WriteLine("SetImage index=" + index.ToString());
         this.ImageData = await reader.CreateBitmapAsync(index);
     }
 }
Esempio n. 5
0
        /// <summary>
        /// Constructor with dependency injection.
        /// </summary>
        /// <param name="mediaItemService"></param>
        /// <param name="tagService"></param>
        /// <param name="view"></param>
        /// <param name="imageFileReader"></param>
        public AddMediaItemPresenter(IMediaItemService mediaItemService, ITagService tagService,
                                     IAddMediaItemForm view,
                                     IImageFileReader imageFileReader)
        {
            this._mediaItemService = mediaItemService;
            this._tagService       = tagService;

            this._view = view;

            this._imageFileReader = imageFileReader;

            this._allTags = new Dictionary <string, bool>();

            // subscribe to the view's events
            this._view.SaveButtonClicked += (async(sender, args) =>
            {
                await HandleSaveButtonClicked(sender, args);
            });
            this._view.InputFieldsUpdated     += InputFieldsUpdated;
            this._view.FilterTagsFieldUpdated += FilterTags;
            this._view.AddNewTagButtonClicked += HandleAddNewTagClicked;
            this._view.TagCheckedChanged      += HandleTagCheckedChanged;
        }//ctor
Esempio n. 6
0
 public MockBookPresenter(IBookService bookRepo, ITagService tagService, IAuthorService authorService, IPublisherService publisherService, IAddBookForm view,
                          IImageFileReader imageFileReader)
     : base(bookRepo, tagService, authorService, publisherService, view, imageFileReader)
 {
 }
Esempio n. 7
0
 public ArticlesController(IImageFileReader imageFileReader, IImageDataHelper imageDataHelper)
 {
     _imageFileReader = imageFileReader;
     _imageDataHelper = imageDataHelper;
 }
Esempio n. 8
0
 public BoardsController(IImageFileReader imageFileReader, IImageDataHelper imageDataHelper)
 {
     _imageFileReader = imageFileReader;
     _imageDataHelper = imageDataHelper;
 }
 public MockPresenter(IMediaItemService mediaItemService, ITagService tagService, IAddMediaItemForm view, IImageFileReader imageFileReader)
     : base(mediaItemService, tagService, view, imageFileReader)
 {
 }
Esempio n. 10
0
 public UsersController(IUserAuthService userAuthService, IImageFileReader imageFileReader, IImageDataHelper imageDataHelper)
 {
     _userAuthService = userAuthService;
     _imageFileReader = imageFileReader;
     _imageDataHelper = imageDataHelper;
 }