/// <summary> /// Adds a new method to the universe /// </summary> /// <param name="method">method to add</param> public void AddMethod(MethodBase method) { Contract.Requires <ArgumentNullException>(method != null); Contract.Requires <InvalidOperationException>(!IsCompleted, UniverseCompletedErrorMsg); var entryPoint = method.UnwrapEntryPoint(); _knownMethods.Cache(entryPoint); }
/// <summary> /// Adds a new type to the universe /// </summary> /// <param name="type">type to add</param> public void AddType(Type type) { Contract.Requires <ArgumentNullException>(type != null); Contract.Requires <InvalidOperationException>(!IsCompleted, UniverseCompletedErrorMsg); if (type.IsGenericType && !type.IsGenericTypeDefinition) { foreach (Type atype in type.GetGenericArguments()) { AddType(atype); } type = type.GetGenericTypeDefinition(); } if (type.IsArray || type.IsPointer || type.IsByRef) { type = type.GetElementType(); } _knownTypes.Cache(type); }
private void OnFieldSeen(FieldInfo field) { _knownFields.Cache(field); }