private static void LoadDictionaryProperties(this PropertyDescriptorsInfo info) { if (TryGetDictionaryValueType(info.Type, out Type valueType)) { info.DictionaryValueType = valueType; } info.Properties = new PropertyDescriptor[0]; }
public static TSource Trim <TSource>(this TSource source, params char[] trimChars) where TSource : class { if (source != null) { Type type = source.GetType(); if (type.IsArray) { ((IEnumerable)source).TrimEnumerable(trimChars); } else { PropertyDescriptorsInfo info = new PropertyDescriptorsInfo(type); info.LoadProperties(new TSource[] { source }); PropertyDescriptor[] properties = GetTrimPropertyDescriptors(info.Properties).ToArray(); source.Trim(info.Kind, properties, trimChars); } } return(source); }
private static MatchProperty[] JoinMatches <T>(PropertyDescriptorsInfo left, PropertyDescriptorsInfo right, Action <IEnumerable <T> > load, IEnumerable <T> items) { if (left.Kind == PropertyDescriptorKind.Class && right.Kind == PropertyDescriptorKind.Class) { int key = GetFullNameHashCode(left.Type, right.Type); if (!_matchesDictionary.TryGetValue(key, out MatchProperty[] matches))
public DictionaryNecessary() { _left = new PropertyDescriptorsInfo(typeof(TDictionary), PropertyDescriptorKind.Dictionary); _right = new PropertyDescriptorsInfo(typeof(T), this); }
protected override void First(ItemValuePair <TSource> first) { _right = new PropertyDescriptorsInfo(first.Value.GetType(), this); }
public ApplyNecessary() { _left = new PropertyDescriptorsInfo(typeof(TSource), this); }
private static void LoadDataRowProperties(this PropertyDescriptorsInfo info, DataTable table, PropertyDescriptor[] properties) { info.Properties = GetDataRowPropertyDescriptors(table, properties).ToArray(); }
public DataRowNecessary(DataTable table) { _table = table; _right = new PropertyDescriptorsInfo(typeof(T), this); _left = new PropertyDescriptorsInfo(typeof(DataRow), PropertyDescriptorKind.DataRow); }
private static void LoadEntityProperties(this PropertyDescriptorsInfo info) { info.Properties = GetPropertyDescriptors(info.Type); }
public EntityNecessary() { _left = new PropertyDescriptorsInfo(typeof(T), PropertyDescriptorKind.Class); _right = new PropertyDescriptorsInfo(typeof(TSource), this); }
protected override void First(object first) { _info = new PropertyDescriptorsInfo(first.GetType(), this); }