private static bool GetPropertyHash(PropertyInfo property, object obj, Action <MemberInfo, int> memberValues, ref int i) { if (BlockedTypes.IsBlocked(Utility.GetObjectMemberName(property))) { return(false); } if (BlockedTypes.IsBlocked(property.PropertyType)) { return(false); } MethodInfo method = property.GetGetMethod(); if (method == null) { return(false); } if (!Utility.CanAccessMember(property)) { return(false); } try { if (property.PropertyType.IsArray) { i = GetArrayID(property.GetValue(obj, null)); } else { i = GetObjectID(property.GetValue(obj, null)); } } catch (TargetException) { throw; } catch (Exception) { return(false); } memberValues?.Invoke(property, i); return(true); }
public static void Initialize() { if (HasInitialized) { return; } HasInitialized = true; HierarchyManager.Initialize(); HookUpJSONReferenceHandler(); OnSerializationStarted?.Invoke(); AssemblyManager.Initialize(); IDManager.Initialize(); Converter.Initialize(); BlockedTypes.Initialize(); BehaviourManager.Initialize(); AssemblyManager.ExecuteReflection(); }
private static bool GetFieldHash(FieldInfo field, object obj, Action <MemberInfo, int> memberValues, ref int i) { if (BlockedTypes.IsBlocked(Utility.GetObjectMemberName(field))) { return(false); } if (BlockedTypes.IsBlocked(field.FieldType)) { return(false); } try { if (field.FieldType.IsArray) { i = GetArrayID(field.GetValue(obj)); } else { i = GetObjectID(field.GetValue(obj)); } } catch (TargetException) { throw; } catch (Exception) { return(false); } memberValues?.Invoke(field, i); return(true); }
private bool IsValid(MemberInfo info) { string objectMemberValue = Utility.GetObjectMemberName(info); return(!BlockedTypes.IsBlocked(objectMemberValue)); }