Exemple #1
0
        static void Main(string[] args)
        {
            var externalConfigPath = @"ConfigTest\Some.External.config";
            var config             = ConfigExtensions.ParseConfig <SomeModuleConfig>(externalConfigPath);

            if (config.IsFailure)
            {
                config = ConfigExtensions.GetMissingValues <SomeModuleConfig>(externalConfigPath)
                         .OnSuccess(missingValues => ConfigExtensions.AddMissingValues(externalConfigPath, missingValues, (name, type) => RerieveMissingValue(new KeyValuePair <string, Type>(name, type)).Value)
                                    .OnSuccess(() => ConfigExtensions.ParseConfig <SomeModuleConfig>(externalConfigPath))
                                    );
            }
            if (config.IsFailure)
            {
                throw new Exception(config.Error);
            }


            //var des = nameValueCollectionNode.DeserializeAsXml<List<add>>(Encoding.UTF8);
        }
        public void CanReadFromAppConfigFileWithLinkedSettingsFile()
        {
            var conf = ConfigExtensions.ParseConfig <Conf>(configFullLinked);

            CheckCorrect(conf.Value);
        }
        public void CanReadFromAppConfigFile()
        {
            var conf = ConfigExtensions.ParseConfig <Conf>(configFull);

            CheckCorrect(conf.Value);
        }
        public void CanReadFromAppSettingsFile()
        {
            var conf = ConfigExtensions.ParseConfig <Conf>(configAppSettings);

            CheckCorrect(conf.Value);
        }