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); }
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); }
public override bool TryGetMember(GetMemberBinder binder, out object result) { result = new XmlTagDynamic(file.Root.FindTagByName(binder.Name)); return(true); }