private static void LoadDictionaryProperties(this PropertyDescriptorsInfo info)
 {
     if (TryGetDictionaryValueType(info.Type, out Type valueType))
     {
         info.DictionaryValueType = valueType;
     }
     info.Properties = new PropertyDescriptor[0];
 }
Esempio n. 2
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);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 5
0
 protected override void First(ItemValuePair <TSource> first)
 {
     _right = new PropertyDescriptorsInfo(first.Value.GetType(), this);
 }
Esempio n. 6
0
 public ApplyNecessary()
 {
     _left = new PropertyDescriptorsInfo(typeof(TSource), this);
 }
Esempio n. 7
0
 private static void LoadDataRowProperties(this PropertyDescriptorsInfo info, DataTable table, PropertyDescriptor[] properties)
 {
     info.Properties = GetDataRowPropertyDescriptors(table, properties).ToArray();
 }
Esempio n. 8
0
 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);
 }
Esempio n. 11
0
 protected override void First(object first)
 {
     _info = new PropertyDescriptorsInfo(first.GetType(), this);
 }