/// <summary> /// 从对象的 XML 表示形式生成该对象。 /// </summary> /// <param name="reader">从中对对象进行反序列化的 <see cref="T:System.Xml.XmlReader" /> 流。</param> public override void ReadXml(XmlReader reader) { List <TypeValueElement> typeList = new List <TypeValueElement>(); int entDepth = reader.Depth; while (reader.Read() && reader.Depth >= entDepth) { //处理开始节点 while (reader.NodeType == XmlNodeType.Element) { TypeValueElement ele = reader.ObjectReadXml <TypeValueElement>(); typeList.Add(ele); } } Arguments = typeList.ToArray(); }
/// <summary> /// 辅助函数,从字符串委托表示法还原(原型:Func<object, object, bool>) /// </summary> /// <param name="boolDelegateStr">布尔委托原型的字符串表示</param> /// <returns></returns> public static Func <object, object, bool> GetBooleanDelegate(string boolDelegateStr) { if (boolDelegateStr.Contains("::")) { return(boolDelegateStr.CreateFromConfig <Func <object, object, bool> >()); } else { TypeValueElement tvElement = new TypeValueElement { Type = typeof(Func <object, object, bool>).FullName, StaticField = true, Value = boolDelegateStr }; return(tvElement.GetObjectValue() as Func <object, object, bool>); } }