Esempio n. 1
0
 protected AutoCatFlags(AutoCatFlags other) : base(other)
 {
     Filter        = other.Filter;
     Prefix        = other.Prefix;
     IncludedFlags = new List <string>(other.IncludedFlags);
     Selected      = other.Selected;
 }
        public override void LoadFromAutoCat(AutoCat autocat)
        {
            AutoCatFlags ac = autocat as AutoCatFlags;

            if (ac == null)
            {
                return;
            }

            txtPrefix.Text = ac.Prefix;

            foreach (ListViewItem item in lstIncluded.Items)
            {
                item.Checked = ac.IncludedFlags.Contains(item.Text);
            }
        }
        public override void SaveToAutoCat(AutoCat autocat)
        {
            AutoCatFlags ac = autocat as AutoCatFlags;

            if (ac == null)
            {
                return;
            }

            ac.Prefix = txtPrefix.Text;

            ac.IncludedFlags.Clear();
            foreach (ListViewItem i in lstIncluded.Items)
            {
                if (i.Checked)
                {
                    ac.IncludedFlags.Add(i.Text);
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// </summary>
        /// <param name="xElement"></param>
        /// <returns></returns>
        public static AutoCat LoadAutoCatFromXmlElement(XmlElement xElement)
        {
            switch (xElement.Name)
            {
            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));

            default:
                return(null);
            }
        }