public BlockAccumulator Nest(ObjectBlock block)
 {
     CurrentObject.AddBlock(block);
     _objectBlocks.Push(block);
     Rank = Rank + 1;
     return(this);
 }
Esempio n. 2
0
        public object Read(Type type, ObjectBlock block)
        {
            var settings = _blocks.SettingsFor(type);

            block.MakeCollections(settings);
            var result = _resolver.BindModel(type, new ObjectBlockValues(block, settings, type));

            return(result.Value);
        }
Esempio n. 3
0
        public override IBlock MakeBlock(Match match)
        {
            var name          = match.Groups[1].Value;
            var implicitValue = match.Groups[2].Value;

            var block = new ObjectBlock(name)
            {
                ImplicitValue = implicitValue
            };

            var otherProperties = match.Groups[3].Value;

            if (otherProperties.IsNotEmpty())
            {
                var propertyBlocks = otherProperties.Split(", ")
                                     .Select(_propertyBlockParser.Parse)
                                     .ToList();

                block.Blocks = propertyBlocks;
            }
            return(block);
        }
 public BlockAccumulator(ObjectBlock root)
 {
     _objectBlocks = new Stack <ObjectBlock>();
     _objectBlocks.Push(root);
 }
Esempio n. 5
0
 public void AddBlock(ObjectBlock block)
 {
     _blocks.Add(block);
 }
Esempio n. 6
0
 public ObjectBlockValues(ObjectBlock root, IObjectBlockSettings settings, Type type)
 {
     _root     = root;
     _settings = settings;
     _type     = type;
 }
Esempio n. 7
0
 public ObjectBlockValues(ObjectBlock root, Type type)
     : this(root, new ObjectBlockSettings(), type)
 {
 }