internal FastDeepClonerProperty(FieldInfo field) { CanRead = !(field.IsInitOnly || field.FieldType == typeof(IntPtr) || field.IsLiteral); FastDeepClonerIgnore = field.GetCustomAttribute <FastDeepClonerIgnore>() != null; Attributes = new AttributesCollections(field.GetCustomAttributes().ToList()); GetMethod = field.GetValue; SetMethod = field.SetValue; Name = field.Name; FullName = field.FieldType.FullName; PropertyType = field.FieldType; IsInternalType = field.FieldType.IsInternalType(); }
internal FastDeepClonerProperty(PropertyInfo property) { CanRead = !(!property.CanWrite || !property.CanRead || property.PropertyType == typeof(IntPtr) || property.GetIndexParameters().Length > 0); FastDeepClonerIgnore = property.GetCustomAttribute <FastDeepClonerIgnore>() != null; GetMethod = property.GetValue; SetMethod = property.SetValue; Attributes = new AttributesCollections(property.GetCustomAttributes().ToList()); Name = property.Name; FullName = property.PropertyType.FullName; PropertyType = property.PropertyType; IsInternalType = property.PropertyType.IsInternalType(); IsVirtual = property.GetMethod.IsVirtual; PropertyGetValue = property.GetMethod; PropertySetValue = property.SetMethod; }