private static void Append(this HashAlgorithm algorithm, PropertyInfo value, bool isFinalAppend = false) { algorithm.Append(PropertyPrefix); algorithm.AppendMemberInfo(value, AttributeBehavior.Include); var indexParameters = value.GetIndexParameters(); foreach (var i in indexParameters) { algorithm.Append(i); } algorithm.Append(indexParameters.Length); if (value.GetMethod == null) { algorithm.Append(ExplicitNull); } else { algorithm.Append(value.GetMethod); } if (value.SetMethod == null) { algorithm.Append(ExplicitNull); } else { algorithm.Append(value.SetMethod); } algorithm.AppendType(value.PropertyType, isFinalAppend); }
private static void Append(this HashAlgorithm algorithm, Type value, AttributeBehavior attributeBehavior, bool isFinalAppend = false) { algorithm.Append(TypePrefix); if (value.IsGenericType) { algorithm.Append(ExplicitTrue); } else { algorithm.Append(ExplicitFalse); } if (value.IsGenericTypeDefinition) { algorithm.Append(ExplicitTrue); } else { algorithm.Append(ExplicitFalse); } // TODO Add more explicit type info for generic versions if (value.IsGenericParameter) { algorithm.Append(ExplicitTrue); } else { algorithm.Append(ExplicitFalse); } if (value.ContainsGenericParameters) { algorithm.Append(ExplicitTrue); } else { algorithm.Append(ExplicitFalse); } if (value.IsArray) { algorithm.Append(ExplicitTrue); algorithm.AppendType(value.GetElementType()); } else { algorithm.Append(ExplicitFalse); } algorithm.AppendMemberInfo(value, attributeBehavior, isFinalAppend); }
private static void Append(this HashAlgorithm algorithm, MethodInfo value, bool isFinalAppend = false) { algorithm.Append(MethodPrefix); algorithm.AppendMemberInfo(value, AttributeBehavior.Include); algorithm.Append((int)value.Attributes); if (value.IsGenericMethod) { algorithm.Append(ExplicitTrue); if (value.IsGenericMethodDefinition) { algorithm.Append(ExplicitTrue); } else { algorithm.Append(ExplicitFalse); } var genericArguments = value.GetGenericArguments(); foreach (var arg in genericArguments) { algorithm.AppendType(arg); } algorithm.Append(genericArguments.Length); } else { algorithm.Append(ExplicitFalse); } var parameters = value.GetParameters(); foreach (var p in parameters) { algorithm.Append(p); } algorithm.Append(parameters.Length); algorithm.AppendType(value.ReturnType, isFinalAppend); }