Exemplo n.º 1
0
Arquivo: Toml.cs Projeto: zanedp/Nett
        public static T ReadString <T>(string toRead, TomlSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            TomlTable tt     = ReadString(toRead, settings);
            T         result = tt.Get <T>();

            return(result);
        }
Exemplo n.º 2
0
        void ITomlObjectVisitor.Visit(TomlTable table)
        {
            Type tableToTypeMappingTargetType;

            if ((tableToTypeMappingTargetType = table.Root.Settings.TryGetMappedType(this.currentKey, null)) != null)
            {
                this.table[this.currentKey] = table.Get(tableToTypeMappingTargetType);
            }
            else
            {
                var conv = new ConvertTomlTableToDictionaryConversionVisitor();
                this.table[this.currentKey] = conv.Convert(table);
            }
        }