コード例 #1
0
        public override void LoadFromAutoCat(AutoCat autoCat)
        {
            AutoCatYear acYear = autoCat as AutoCatYear;

            if (acYear == null)
            {
                return;
            }

            txtPrefix.Text            = acYear.Prefix ?? string.Empty;
            chkIncludeUnknown.Checked = acYear.IncludeUnknown;
            txtUnknownText.Text       = acYear.UnknownText ?? string.Empty;
            switch (acYear.GroupingMode)
            {
            case AutoCatYearGrouping.Decade:
                radGroupDec.Checked = true;
                break;

            case AutoCatYearGrouping.HalfDecade:
                radGroupHalf.Checked = true;
                break;

            default:
                radGroupNone.Checked = true;
                break;
            }
        }
コード例 #2
0
        public override void SaveToAutoCat(AutoCat autoCat)
        {
            AutoCatYear ac = autoCat as AutoCatYear;

            if (ac == null)
            {
                return;
            }

            ac.Prefix         = txtPrefix.Text;
            ac.IncludeUnknown = chkIncludeUnknown.Checked;
            ac.UnknownText    = txtUnknownText.Text;
            if (radGroupNone.Checked)
            {
                ac.GroupingMode = AutoCatYearGrouping.None;
            }
            else if (radGroupHalf.Checked)
            {
                ac.GroupingMode = AutoCatYearGrouping.HalfDecade;
            }
            else if (radGroupDec.Checked)
            {
                ac.GroupingMode = AutoCatYearGrouping.Decade;
            }
        }
コード例 #3
0
 protected AutoCatYear(AutoCatYear other) : base(other)
 {
     Filter         = other.Filter;
     Prefix         = other.Prefix;
     IncludeUnknown = other.IncludeUnknown;
     UnknownText    = other.UnknownText;
     GroupingMode   = other.GroupingMode;
     Selected       = other.Selected;
 }
コード例 #4
0
ファイル: AutoCat.cs プロジェクト: yfdyh000/Depressurizer
        public static AutoCat LoadACFromXmlElement(XmlElement xElement)
        {
            string type = xElement.Name;

            switch (type)
            {
            case AutoCatGenre.TypeIdString:
                return(AutoCatGenre.LoadFromXmlElement(xElement));

            case AutoCatFlags.TypeIdString:
                return(AutoCatFlags.LoadFromXmlElement(xElement));

            case AutoCatTags.TypeIdString:
                return(AutoCatTags.LoadFromXmlElement(xElement));

            case AutoCatYear.TypeIdString:
                return(AutoCatYear.LoadFromXmlElement(xElement));

            case AutoCatUserScore.TypeIdString:
                return(AutoCatUserScore.LoadFromXmlElement(xElement));

            case AutoCatHltb.TypeIdString:
                return(AutoCatHltb.LoadFromXmlElement(xElement));

            case AutoCatManual.TypeIdString:
                return(AutoCatManual.LoadFromXmlElement(xElement));

            case AutoCatDevPub.TypeIdString:
                return(AutoCatDevPub.LoadFromXmlElement(xElement));

            case AutoCatGroup.TypeIdString:
                return(AutoCatGroup.LoadFromXmlElement(xElement));

            case AutoCatName.TypeIdString:
                return(AutoCatName.LoadFromXmlElement(xElement));

            case AutoCatVrSupport.TypeIdString:
                return(AutoCatVrSupport.LoadFromXmlElement(xElement));

            case AutoCatLanguage.TypeIdString:
                return(AutoCatLanguage.LoadFromXmlElement(xElement));

            case AutoCatCurator.TypeIdString:
                return(LoadFromXmlElement(xElement, typeof(AutoCatCurator)));

            case AutoCatPlatform.TypeIdString:
                return(LoadFromXmlElement(xElement, typeof(AutoCatPlatform)));

            case AutoCatHoursPlayed.TypeIdString:
                return(AutoCatHoursPlayed.LoadFromXmlElement(xElement));

            default:
                return(null);
            }
        }