Beispiel #1
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            ChapterGroup group = value as ChapterGroup;

            if (group != null)
            {
                return(group.Chapters.Count(x => x.IsRead) > 0 ? Visibility.Visible : Visibility.Collapsed);
            }
            return(Visibility.Collapsed);
        }
Beispiel #2
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            ChapterGroup group = value as ChapterGroup;

            if (group != null)
            {
                return(group.Chapters.Count(x => x.IsRead));
            }
            return(0);
        }
Beispiel #3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (LevelId != 0)
            {
                hash ^= LevelId.GetHashCode();
            }
            if (BeforeLevelId != 0)
            {
                hash ^= BeforeLevelId.GetHashCode();
            }
            if (AfterLevelId != 0)
            {
                hash ^= AfterLevelId.GetHashCode();
            }
            if (Type != 0)
            {
                hash ^= Type.GetHashCode();
            }
            hash ^= abilities_.GetHashCode();
            hash ^= ItemMax.GetHashCode();
            hash ^= FansMax.GetHashCode();
            if (Max != 0)
            {
                hash ^= Max.GetHashCode();
            }
            hash ^= eventId_.GetHashCode();
            hash ^= StarSource.GetHashCode();
            hash ^= awards_.GetHashCode();
            if (GameType != 0)
            {
                hash ^= GameType.GetHashCode();
            }
            if (LevelInfoId != 0)
            {
                hash ^= LevelInfoId.GetHashCode();
            }
            if (ChapterGroup != 0)
            {
                hash ^= ChapterGroup.GetHashCode();
            }
            if (LevelMark.Length != 0)
            {
                hash ^= LevelMark.GetHashCode();
            }
            hash ^= LevelPlot.GetHashCode();
            hash ^= levelCoordinate_.GetHashCode();
            hash ^= levelBackdrop_.GetHashCode();
            if (levelExtra_ != null)
            {
                hash ^= LevelExtra.GetHashCode();
            }
            return(hash);
        }
Beispiel #4
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            ChapterGroup group = value as ChapterGroup;

            if (group != null)
            {
                var readCount = group.Chapters.Count(x => x.IsRead);
                var progress  = (double)readCount / (double)group.Chapters.Count;
                return(progress);
            }
            return(0d);
        }
Beispiel #5
0
        private void CreateData()
        {
            _data.Clear();
            var directories = Directory.GetDirectories(_path);

            foreach (var directory in directories)
            {
                var chapterGroup = new ChapterGroup(_directoryService.GetLastDirectoryName(directory), directory);
                var chapters     = Directory.GetFiles(directory);
                foreach (var chapter in chapters)
                {
                    chapterGroup.Add(new Chapter(Path.GetFileName(chapter), chapter));
                }
                _data.Add(chapterGroup);
            }
        }