Ejemplo n.º 1
0
        void CoalesceSubtitles(SubtitleConfig userConfig, SubtitleConfig defaultConfig)
        {
            if (userConfig.Codecs?.Any() != true)
            {
                userConfig.Codecs = defaultConfig.Codecs;
                return;
            }

            if (defaultConfig.Codecs?.Any() != true)
            {
                return;
            }

            foreach (var pair in userConfig.Codecs)
            {
                var format       = pair.Key;
                var userCodec    = pair.Value;
                var defaultCodec = defaultConfig.Codecs.GetValueOrDefault(format);

                if (string.IsNullOrWhiteSpace(userCodec.Name) && defaultCodec != null)
                {
                    userCodec.Name = defaultCodec.Name;
                }
            }
        }
Ejemplo n.º 2
0
        public CtrlSetting()
        {
            InitializeComponent();

            this.systemConfig        = SystemConfig.ReadConfig();
            this.titleConfig         = TitleConfig.ReadConfig();
            this.subtitleConfig      = SubtitleConfig.ReadConfig();
            this.scrollTextConfig    = ScrollTextConfig.ReadConfig();
            this.lotteryButtonConfig = LotteryButtonConfig.ReadConfig();
            this.lotteryBoxConfig    = LotteryBoxConfig.ReadConfig();
        }