protected override PropertyDescriptorCollection GetProperties(object obj, IXtraPropertyCollection store) { PropertyDescriptorCollection properties = base.GetProperties(obj, store); foreach (XtraPropertyInfo storeItem in store) { CustomPropertyValueEventArgs args = new CustomPropertyValueEventArgs(obj, storeItem.Name); args.PropertyValue = storeItem.Value; ((MyGridView)DeserializeHelper.RootObject).RaiseGetCustomPropertyValue(args); } return(properties); }
protected override void DeserializeObject( object obj, IXtraPropertyCollection store, OptionsLayoutBase options) { if (options == null) options = OptionsLayoutBase.FullLayout; if (store == null) return; var coll = new XtraPropertyCollection(); coll.AddRange(store); var helper = new DeserializeHelper(obj, false); helper.DeserializeObject(obj, coll, options); }
protected override void DeserializeObject( object obj, IXtraPropertyCollection store, OptionsLayoutBase options) { options ??= OptionsLayoutBase.FullLayout; if (store == null) { return; } var coll = new XtraPropertyCollection(); coll.AddRange(store); var helper = new DeserializeHelper(obj, false); helper.DeserializeObject(obj, coll, options); }
static IXtraPropertyCollection GetFilterCollection(ColumnView view, IXtraPropertyCollection collection) { string filterNames = "|ActiveFilterEnabled|ActiveFilterString|MRUFilters|"; IXtraPropertyCollection ret; using (Stream ms = new MemoryStream()) { view.SaveLayoutToStream(ms, view.OptionsLayout); ms.Position = 0; ret = Instance.Deserialize(ms, "View", null); foreach (XtraPropertyInfo pi in collection) { if (filterNames.Contains(string.Format("|{0}|", pi.Name))) { ret.Add(pi); } } } return(ret); }
protected override PropertyDescriptorCollection GetProperties(object obj, IXtraPropertyCollection store) { PropertyDescriptorCollection propertyDescriptors = base.GetProperties(obj, store); if (store == null) { return(propertyDescriptors); } PropertyDescriptorCollection newPropertyDescriptors = new PropertyDescriptorCollection(null); foreach (XtraPropertyInfo info in store) { PropertyDescriptor pd = propertyDescriptors[info.Name]; if (pd != null) { newPropertyDescriptors.Add(pd); } } return(newPropertyDescriptors); }
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); }
public static void LoadFilter(ColumnView view, string file) { IXtraPropertyCollection collection = Instance.Deserialize(file, "View", null); Instance.DeserializeObject(view, GetFilterCollection(view, collection), view.OptionsLayout); }