Beispiel #1
0
        public LocalDataManager()
        {
            ReviewPage = null;
            SortPage   = null;
            StatPage   = null;
            TagPage    = null;

            //Generate all of the tags upon construction.
            DBManager = new DatabaseManager();

            InstrumentTags = new List <TagObject>();
            LanguageTags   = new List <TagObject>();
            GenreTags      = new List <TagObject>();

            Tags = DBManager.GetAllTags();

            foreach (TagObject Tag in Tags)
            {
                switch (Tag.Type)
                {
                case TagType.Genre:
                    GenreTags.Add(Tag);
                    break;

                case TagType.Instrument:
                    InstrumentTags.Add(Tag);
                    break;

                case TagType.Language:
                    LanguageTags.Add(Tag);
                    break;
                }
            }

            //Sort in Alphabetical Order:
            GenreTags.Sort((r1, r2) => r1.Name.CompareTo(r2.Name));
            LanguageTags.Sort((r1, r2) => r1.Name.CompareTo(r2.Name));
            InstrumentTags.Sort((r1, r2) => r1.Name.CompareTo(r2.Name));
        }
Beispiel #2
0
        private Page createNewPage(PageTypes type)
        {
            switch (type)
            {
            case PageTypes.ReviewPage:
                this.ReviewPage = new ReviewPage(this);
                return(this.ReviewPage);

            case PageTypes.SortPage:
                this.SortPage = new SortPage(this);
                return(this.SortPage);

            case PageTypes.StatPage:
                this.StatPage = new StatPage(this);
                return(this.StatPage);

            case PageTypes.TagPage:
                this.TagPage = new TagPage(this);
                return(this.TagPage);
            }

            return(null);
        }