コード例 #1
0
 public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
 {
     if (indexes.Length == 1)
     {
         var index = new NodeIndex(indexes[0]);
         if (IsIndexExisting(Node, index))
         {
             result = new DynamicIndexedNode(Node, index);
             return(true);
         }
     }
     result = null;
     return(false);
 }
コード例 #2
0
        public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
        {
            var targetNode = GetTargetNode();

            if (indexes.Length == 1 && targetNode != null)
            {
                var nextIndex = new NodeIndex(indexes[0]);
                if (IsIndexExisting(targetNode, nextIndex))
                {
                    result = new DynamicIndexedNode(targetNode, nextIndex);
                    return(true);
                }
            }
            result = null;
            return(false);
        }