Inheritance: TomlObject
Esempio n. 1
0
        // Table Array
        public static TomlTableArray Update <T>(
            this TomlTable table, string key, IEnumerable <T> items, TomlTable.TableTypes type = TomlTable.TableTypes.Default)
        {
            TomlTableArray tblArray = CreateAttached(table, items, type);

            table[key] = tblArray;
            return(tblArray);
        }
Esempio n. 2
0
        internal TomlTableArray TableArrayWithRoot(ITomlRoot root)
        {
            root.CheckNotNull(nameof(root));

            var a = new TomlTableArray(root, this.Items.Select(t => t.TableWithRoot(root)));

            return(a);
        }
Esempio n. 3
0
        public static TomlTableArray AddTableArray(this TomlTable table, string key, TomlTableArray array)
        {
            if (array.Root != table.Root)
            {
                throw new InvalidOperationException("Cannot add TOML table array to table because it belongs to a different graph root.");
            }

            table.AddRow(new TomlKey(key), array);
            return(array);
        }
        void ITomlObjectVisitor.Visit(TomlTableArray tableArray)
        {
            var arr = new Dictionary <string, object> [tableArray.Count];

            for (int i = 0; i < tableArray.Count; i++)
            {
                var conv = new ConvertTomlTableToDictionaryConversionVisitor();
                arr[i] = conv.Convert(tableArray[i]);
            }

            this.table[this.currentKey] = arr;
        }
        void ITomlObjectVisitor.Visit(TomlTableArray tableArray)
        {
            var arr = new Dictionary<string, object>[tableArray.Count];

            for (int i = 0; i < tableArray.Count; i++)
            {
                var conv = new ConvertTomlTableToDictionaryConversionVisitor();
                arr[i] = conv.Convert(tableArray[i]);
            }

            this.table[this.currentKey] = arr;
        }
Esempio n. 6
0
        internal TomlTableArray TableArrayWithRoot(ITomlRoot root)
        {
            root.CheckNotNull(nameof(root));

            var a = new TomlTableArray(root, this.Items.Select(t => t.TableWithRoot(root)));
            return a;
        }
 public void Visit(TomlTableArray tableArray) => Debug.Assert(false);
 public void Visit(TomlTableArray tableArray) => Debug.Assert(false);