protected override void DeserializeObject(object obj, IXtraPropertyCollection store, OptionsLayoutBase options) { if (store == null) { return; } if (options == null) { options = OptionsLayoutBase.FullLayout; } XtraPropertyCollection coll = new XtraPropertyCollection(); coll.AddRange(store); DeserializeHelper helper = new MyDeserializeHelper(obj); helper.DeserializeObject(obj, coll, options); }
protected override bool AllowProperty(SerializeHelperBase helper, object obj, PropertyDescriptor prop, OptionsLayoutBase options, bool isSerializing) { MyDeserializeHelper myHelper = helper as MyDeserializeHelper; if (myHelper == null || !(myHelper.RootObject is MyGridView)) { return(base.AllowProperty(helper, obj, prop, options, isSerializing)); } bool allow = base.AllowProperty(helper, obj, prop, options, isSerializing); if (customProperties == null || Array.IndexOf(customProperties, prop.Name) == -1) { return(allow); } PropertyInfo[] propInfos = obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance); PropertyInfo property = Array.Find(propInfos, info => info.Name == prop.Name); return(property != null); }