internal TypeInfo(SerializationInfo info, StreamingContext context) { _assembly = (MiniAssembly)info.GetValue(AssemblyFieldName, typeof(MiniAssembly)); _module = (MiniModule)info.GetValue(ModuleFieldName, typeof(MiniModule)); _mdToken = (MetadataToken)info.GetValue(MDTokenFieldName, typeof(MetadataToken)); _typeName = info.GetString(TypeNameFieldName); _nameSpace = info.GetString(NameSpaceFieldName); _assemblyQualifiedName = info.GetString(AssemblyQualifiedFieldName); _representation = (Representation)info.GetInt32(RepresentationFieldName); System.Diagnostics.Contracts.Contract.Assert((_representation & Representation.ReflectionType) == 0); _isGeneric = info.GetBoolean(IsGenericFieldName); }
internal TypeInfo(MetadataToken typeDef, MiniAssembly assembly, MiniModule module, String typeName, String nameSpace, bool isGeneric) { System.Diagnostics.Contracts.Contract.Requires(assembly != null); System.Diagnostics.Contracts.Contract.Requires(module != null); System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(typeName)); System.Diagnostics.Contracts.Contract.Requires(typeDef.Table == MDTables.Tables.TypeDef); _mdToken = typeDef; _assembly = assembly; _module = module; _typeName = typeName; _nameSpace = nameSpace; _assemblyQualifiedName = FullTypeName + ", " + assembly.FullName; _representation = Representation.Token | Representation.Name | Representation.AssemblyQualifiedName; _isGeneric = isGeneric; }