Beispiel #1
0
        private async void Download(IUICommand command)
        {
            var commandId = (DownLoadType)command.Id;

            try
            {
                if (commandId == DownLoadType.DownloadSeriesWithLocalFolderCommandId)
                {
                    IsDownloadSeriesCompleted = await _mangaSource.DownloadMangaWithLocalFolderAsync(_manga);
                }
                else if (commandId == DownLoadType.DownloadSeriesWithSpecifyFolderCommandId)
                {
                    IsDownloadSeriesCompleted = await _mangaSource.DownloadMangaWithSpecifyFolderAsync(_manga);
                }
                else if (commandId == DownLoadType.DownloadSelectedChaptersWithLocalFolderCommandId)
                {
                    var selectedChaptersViewModel = ChapterCollection.Where(p => p.IsSelected == true);
                    var chapters = selectedChaptersViewModel.Select(p => p.GetChapter()).ToList();
                    IsDownloadSeriesCompleted = await _mangaSource.DownloadMangaWithLocalFolderAsync(_manga, chapters);
                }
                else if (commandId == DownLoadType.DownloadSelectedChapterWithSpecifyFolderCommandId)
                {
                    var selectedChaptersViewModel = ChapterCollection.Where(p => p.IsSelected == true);
                    var chapters = selectedChaptersViewModel.Select(p => p.GetChapter()).ToList();
                    IsDownloadSeriesCompleted = await _mangaSource.DownloadMangaWithSpecifyFolderAsync(_manga, chapters);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("MangaDetailViewModel - Download Series With Local Folder - Exception: " + ex.Message);
            }
            OnPropertyChanged("IsDownloadSeriesCompleted");
        }
Beispiel #2
0
        private async void GetDataAsync()
        {
            // show the progress visualization
            Chapters.IsRefreshing = true;

            // clear the collections
            ChapterCollection.Clear();
            VerseCollection.Clear();

            await MainPageViewModel.PopulateCollectionsAsync(ChapterCollection, VerseCollection, Helpers.Settings.Version);

            // hide the progress visualization
            Chapters.IsRefreshing = false;
        }
        public ChapterCollection GetAllChapter()
        {
            var dataTable = _sqlHelper.GetDataTable("select * from Chapter");
            var chapterCollection = new ChapterCollection();

            for (var i = 0; i < dataTable.Rows.Count; i++)
            {
                var chapter = new Chapter()
                                  {
                                      Id = Convert.ToInt32(dataTable.Rows[i]["Id"].ToString()),
                                      ChapterName = dataTable.Rows[i]["ChapterName"].ToString()
                                  };
                chapterCollection.Add(chapter);
            }

            return chapterCollection;
        }
Beispiel #4
0
        private void CollectionsInit()
        {
            //TODO: Нужно ли перенести в бд?
            AuthorsChapters = new ChapterCollection()
            {
                new ChapterVM()
                {
                    Name = "Бизнес и свое дело", Id = 107
                },
                new ChapterVM()
                {
                    Name = "Дизайн и креатив", Id = 108
                },
                new ChapterVM()
                {
                    Name = "Здоровье и быт", Id = 109
                },
                new ChapterVM()
                {
                    Name = "Психология и отношения", Id = 110
                },
                new ChapterVM()
                {
                    Name = "Хобби и увлечения", Id = 111
                }
            };

            TranslationsChapters = new ChapterCollection()
            {
                new ChapterVM()
                {
                    Name = "Программирование", Id = 112
                },
                new ChapterVM()
                {
                    Name = "Бизнес и свое дело", Id = 113
                },
                new ChapterVM()
                {
                    Name = "Дизайн и креатив", Id = 114
                },
                new ChapterVM()
                {
                    Name = "Здоровье и быт", Id = 115
                },
                new ChapterVM()
                {
                    Name = "Психология и отношения", Id = 116
                },
                new ChapterVM()
                {
                    Name = "Хобби и увлечения", Id = 117
                }
            };

            CommonChapters = new ChapterCollection()
            {
                new ChapterVM()
                {
                    Name = "Курсы по программированию", Id = 21
                },
                new ChapterVM()
                {
                    Name = "Курсы по администрированию", Id = 16
                },
                new ChapterVM()
                {
                    Name = "Курсы по бизнесу", Id = 24
                },
                new ChapterVM()
                {
                    Name = "Бухгалтерия и финансы", Id = 103
                },
                new ChapterVM()
                {
                    Name = "Курсы по SEO и SMM", Id = 26
                },
                new ChapterVM()
                {
                    Name = "Курсы по дизайну", Id = 19
                },
                new ChapterVM()
                {
                    Name = "Курсы по фото и видео", Id = 78
                },
                new ChapterVM()
                {
                    Name = "Курсы по музыке", Id = 60
                },
                new ChapterVM()
                {
                    Name = "Электронные книги", Id = 30
                },
                new ChapterVM()
                {
                    Name = "Курсы по здоровью", Id = 71
                },
                new ChapterVM()
                {
                    Name = "Курсы по самообороне", Id = 118
                },
                new ChapterVM()
                {
                    Name = "Отдых и путешествия", Id = 97
                },
                new ChapterVM()
                {
                    Name = "Курсы по психологии", Id = 38
                },
                new ChapterVM()
                {
                    Name = "Курсы по эзотерике", Id = 98
                },
                new ChapterVM()
                {
                    Name = "Курсы по соблазнению", Id = 59
                },
                new ChapterVM()
                {
                    Name = "Имидж и стиль", Id = 102
                },
                new ChapterVM()
                {
                    Name = "Дети и родители", Id = 95
                },
                new ChapterVM()
                {
                    Name = "Школа и репетиторство", Id = 104
                },
                new ChapterVM()
                {
                    Name = "Хобби и рукоделие", Id = 99
                },
                new ChapterVM()
                {
                    Name = "Строительство и ремонт", Id = 94
                },
                new ChapterVM()
                {
                    Name = "Сад и огород", Id = 101
                },
                new ChapterVM()
                {
                    Name = "Авто-мото", Id = 100
                },
                new ChapterVM()
                {
                    Name = "Скрипты и программы", Id = 32
                },
                new ChapterVM()
                {
                    Name = "Шаблоны и темы", Id = 82
                },
                new ChapterVM()
                {
                    Name = "Базы и каталоги", Id = 58
                },
                new ChapterVM()
                {
                    Name = "Покер, ставки, казино", Id = 36
                },
                new ChapterVM()
                {
                    Name = "Спортивные события", Id = 69
                },
                new ChapterVM()
                {
                    Name = "Форекс и инвестиции", Id = 37
                },
                new ChapterVM()
                {
                    Name = "Доступ к платным ресурсам", Id = 31
                },
                new ChapterVM()
                {
                    Name = "Иностранные языки", Id = 83
                },
                new ChapterVM()
                {
                    Name = "Разные аудио и видеокурсы", Id = 28
                }
            };

            AuthorsChapters.IsSelectedAll      = true;
            TranslationsChapters.IsSelectedAll = true;
            CommonChapters.IsSelectedAll       = true;
        }