private object CreateAdapterInstance(IDictionary dictionary, PropertyDescriptor descriptor, Type adapterType) { var metaBindings = BindingFlags.Public | BindingFlags.Static | BindingFlags.GetField; var meta = (DictionaryAdapterMeta)adapterType.InvokeMember("__meta", metaBindings, null, null, null); var instance = new DictionaryAdapterInstance(dictionary, meta, descriptor, this); return(Activator.CreateInstance(adapterType, instance)); }
public DictionaryAdapterBase(DictionaryAdapterInstance instance) { This = instance; CanEdit = typeof(IEditableObject).IsAssignableFrom(Meta.Type); CanNotify = typeof(INotifyPropertyChanged).IsAssignableFrom(Meta.Type); CanValidate = typeof(IDataErrorInfo).IsAssignableFrom(Meta.Type); Initialize(); }
public DictionaryAdapterBase(DictionaryAdapterInstance instance) { This = instance; CanEdit = typeof(IEditableObject).IsAssignableFrom(Meta.Type); CanNotify = typeof(INotifyPropertyChanged).IsAssignableFrom(Meta.Type); #if FEATURE_IDATAERRORINFO CanValidate = typeof(IDataErrorInfo).IsAssignableFrom(Meta.Type); #else CanValidate = false; #endif Initialize(); }
public object CreateInstance(IDictionary dictionary, PropertyDescriptor descriptor) { var instance = new DictionaryAdapterInstance(dictionary, this, descriptor, Factory); return(creator(instance)); }