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

            if (ac == null)
            {
                return;
            }

            txtPrefix.Text = ac.Prefix;

            chkIncludeTypePrefix.Checked = ac.IncludeTypePrefix;
            chkTypeFallback.Checked      = ac.TypeFallback;

            foreach (ListViewItem item in lstInterface.Items)
            {
                item.Checked = ac.IncludedLanguages.Interface.Contains(item.Text);
            }

            foreach (ListViewItem item in lstSubtitles.Items)
            {
                item.Checked = ac.IncludedLanguages.Subtitles.Contains(item.Text);
            }

            foreach (ListViewItem item in lstFullAudio.Items)
            {
                item.Checked = ac.IncludedLanguages.FullAudio.Contains(item.Text);
            }
        }
コード例 #2
0
 protected AutoCatLanguage(AutoCatLanguage other) : base(other)
 {
     Filter            = other.Filter;
     Prefix            = other.Prefix;
     IncludeTypePrefix = other.IncludeTypePrefix;
     TypeFallback      = other.TypeFallback;
     IncludedLanguages = other.IncludedLanguages;
     Selected          = other.Selected;
 }
コード例 #3
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(LoadFromXmlElement(xElement, typeof(AutoCatCurator)));

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

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

            default:
                return(null);
            }
        }
コード例 #4
0
        public override void SaveToAutoCat(AutoCat autoCat)
        {
            AutoCatLanguage ac = autoCat as AutoCatLanguage;

            if (ac == null)
            {
                return;
            }

            ac.Prefix = txtPrefix.Text;

            ac.IncludeTypePrefix = chkIncludeTypePrefix.Checked;
            ac.TypeFallback      = chkTypeFallback.Checked;

            ac.IncludedLanguages.Interface.Clear();
            ac.IncludedLanguages.Subtitles.Clear();
            ac.IncludedLanguages.FullAudio.Clear();

            foreach (ListViewItem i in lstInterface.Items)
            {
                if (i.Checked)
                {
                    ac.IncludedLanguages.Interface.Add(i.Text);
                }
            }

            foreach (ListViewItem i in lstSubtitles.Items)
            {
                if (i.Checked)
                {
                    ac.IncludedLanguages.Subtitles.Add(i.Text);
                }
            }

            foreach (ListViewItem i in lstFullAudio.Items)
            {
                if (i.Checked)
                {
                    ac.IncludedLanguages.FullAudio.Add(i.Text);
                }
            }
        }