コード例 #1
0
        } // RegisterConfiguration

        #endregion

        #region Basic app configuration

        protected InitializationResult LoadBasicConfiguration(string overrideBasePath)
        {
            InitializationResult initResult;

            initResult = LoadRegistrySettings(overrideBasePath);
            if (initResult.IsError)
            {
                return(initResult);
            }

            // Cultures
            Cultures = GetUiCultures();

            // Record tasks
            Folders.RecordTasks = Path.Combine(Folders.Base, Properties.InvariantTexts.FolderRecordTasks);

            // Cache
            Folders.Cache = Path.Combine(Folders.Base, Properties.InvariantTexts.FolderCache);

            // Logos
            Folders.Logos = new AppUiConfigurationFolders.FolderLogos(Path.Combine(Folders.Base, Properties.InvariantTexts.FolderLogosRoot));

            var descriptionServiceType = new Dictionary <string, string>();

            descriptionServiceType.Add("1", Properties.Texts.DvbServiceTypeDescription_01);  // SD TV
            descriptionServiceType.Add("2", Properties.Texts.DvbServiceTypeDescription_02);  // Radio (MPEG-1)
            descriptionServiceType.Add("3", Properties.Texts.DvbServiceTypeDescription_03);  // Teletext
            descriptionServiceType.Add("6", Properties.Texts.DvbServiceTypeDescription_06);  // Mosaic
            descriptionServiceType.Add("10", Properties.Texts.DvbServiceTypeDescription_10); // Radio (AAC)
            descriptionServiceType.Add("11", Properties.Texts.DvbServiceTypeDescription_11); // Mosaic (AAC)
            descriptionServiceType.Add("12", Properties.Texts.DvbServiceTypeDescription_12); // Data
            descriptionServiceType.Add("16", Properties.Texts.DvbServiceTypeDescription_16); // DVB MHP
            descriptionServiceType.Add("17", Properties.Texts.DvbServiceTypeDescription_17); // HD TV (MPEG-2)
            descriptionServiceType.Add("22", Properties.Texts.DvbServiceTypeDescription_22); // SD TV (AVC)
            descriptionServiceType.Add("25", Properties.Texts.DvbServiceTypeDescription_25); // "HD TV
            DescriptionServiceTypes = descriptionServiceType;

            // TODO: load from user config
            DisplayPreferredOrFirst = true;

            // Validate application configuration
            initResult = Validate();
            if (!initResult.IsOk)
            {
                return(initResult);
            }

            // Initialize managers and providers
            if (!Directory.Exists(Folders.RecordTasks))
            {
                Directory.CreateDirectory(Folders.RecordTasks);
            } // if

            Cache = new CacheManager(Folders.Cache);

            ProviderLogoMappings = new ProviderLogoMappings(Folders.Logos.FileProviderMappings);
            ServiceLogoMappings  = new ServiceLogoMappings(Folders.Logos.FileServiceDomainMappings, Folders.Logos.FileServiceMappings);

            return(InitializationResult.Ok);
        } // LoadBasicConfiguration
コード例 #2
0
        } // GetBroadcastList

        protected IDictionary <string, ServiceLogoMappings.ReplacementDomain> GetDomainMappings()
        {
            var xmlMappings = LogosCommon.ParseDomainMappingsXml(AppUiConfiguration.Current.Folders.Logos.FileServiceDomainMappings);

            return(ServiceLogoMappings.BuildMapping(xmlMappings));
        } // GetDomainMappings