コード例 #1
0
 public BlockAccumulator Nest(ObjectBlock block)
 {
     CurrentObject.AddBlock(block);
     _objectBlocks.Push(block);
     Rank = Rank + 1;
     return(this);
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #4
0
 public BlockAccumulator(ObjectBlock root)
 {
     _objectBlocks = new Stack <ObjectBlock>();
     _objectBlocks.Push(root);
 }
コード例 #5
0
 public void AddBlock(ObjectBlock block)
 {
     _blocks.Add(block);
 }
コード例 #6
0
 public ObjectBlockValues(ObjectBlock root, IObjectBlockSettings settings, Type type)
 {
     _root     = root;
     _settings = settings;
     _type     = type;
 }
コード例 #7
0
 public ObjectBlockValues(ObjectBlock root, Type type)
     : this(root, new ObjectBlockSettings(), type)
 {
 }