コード例 #1
0
 protected AutoCatCurator(AutoCatCurator other) : base(other)
 {
     Filter                  = other.Filter;
     CategoryName            = other.CategoryName;
     CuratorUrl              = other.CuratorUrl;
     IncludedRecommendations = other.IncludedRecommendations == null ? new List <CuratorRecommendation>() : other.IncludedRecommendations;
     Selected                = other.Selected;
 }
コード例 #2
0
        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(AutoCatCurator.LoadFromXmlElement(xElement, typeof(AutoCatCurator)));

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

            default:
                return(null);
            }
        }
コード例 #3
0
        public override void LoadFromAutoCat(AutoCat autoCat)
        {
            AutoCatCurator ac = autoCat as AutoCatCurator;

            if (ac == null)
            {
                return;
            }

            txtCategoryName.Text = ac.CategoryName;
            txtCuratorUrl.Text   = ac.CuratorUrl;

            foreach (CuratorRecommendation rec in ac.IncludedRecommendations)
            {
                lstIncluded.Items[rec.GetHashCode() - 1].Checked = true;
            }
        }
コード例 #4
0
        public override void SaveToAutoCat(AutoCat autoCat)
        {
            AutoCatCurator ac = autoCat as AutoCatCurator;

            if (ac == null)
            {
                return;
            }

            ac.CategoryName = txtCategoryName.Text;
            ac.CuratorUrl   = txtCuratorUrl.Text;

            ac.IncludedRecommendations.Clear();
            foreach (ListViewItem i in lstIncluded.Items)
            {
                if (i.Checked)
                {
                    ac.IncludedRecommendations.Add((CuratorRecommendation)Enum.Parse(typeof(CuratorRecommendation), i.Tag.ToString()));
                }
            }
        }