コード例 #1
0
        public TagginWindow(LocalDataManager LocalData, ReviewObject givenReview, ReviewPage Parent_Page)
        {
            InitializeComponent();

            //Keep a list of all tags that are selected to be "submitted" to the review later.
            SelectedTags = new List <TagObject>(givenReview.getTags());

            this.Parent_Page = Parent_Page;
            this.LocalData   = LocalData;

            AdvanceSearchWindow = null;

            CreateTagBoxes(givenReview.getTags());
        }
コード例 #2
0
        public TagginWindow(LocalDataManager LocalData, AdvanceSearchWindow AdvanceSearchWindow, List <TagObject> GivenTags, bool Including)
        {
            InitializeComponent();

            this.Including           = Including;
            this.AdvanceSearchWindow = AdvanceSearchWindow;
            this.LocalData           = LocalData;

            if (GivenTags == null)
            {
                SelectedTags = new List <TagObject>();
            }
            else
            {
                SelectedTags = GivenTags;
            }

            Parent_Page = null;
            CreateTagBoxes(SelectedTags);
        }
コード例 #3
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));
        }
コード例 #4
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);
        }