示例#1
0
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     if (binder.Name == "Value")
     {
         result = tag.Value;
     }
     else
     {
         result = new XmlTagDynamic(tag.FindTagByName(binder.Name));
     }
     return(true);
 }
示例#2
0
 public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
 {
     if (indexes.Length == 2)
     {
         if (indexes[0] is string && indexes[1] is string)
         {
             result = new XmlTagDynamic(tag.Parent.FindTagByNameAndAttribute(tag.Name, (string)indexes[0], (string)indexes[1]));
         }
         else
         {
             Debug.Assert(false);
             result = null;
             return(false);
         }
     }
     else if (indexes.Length == 1)
     {
         if (indexes[0] is int)
         {
             result = new XmlTagDynamic(tag.Parent.Children[(int)indexes[0]]);
         }
         else
         {
             Debug.Assert(false);
             result = null;
             return(false);
         }
     }
     else
     {
         Debug.Assert(false);
         result = null;
         return(false);
     }
     return(true);
 }
示例#3
0
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     result = new XmlTagDynamic(file.Root.FindTagByName(binder.Name));
     return(true);
 }