public bool Equals(ModuleDescriptor obj, VersionToleranceLevel versionToleranceLevel)
 {
     if(versionToleranceLevel.HasFlag(VersionToleranceLevel.AllowGuidChange))
     {
         return obj != null && obj.Name == Name && ModuleAssembly.Equals(obj.ModuleAssembly, versionToleranceLevel);
     }
     return obj != null && obj.GUID == GUID && ModuleAssembly.Equals(obj.ModuleAssembly, versionToleranceLevel);
 }
        private void Init(Type t)
        {
            UnderlyingType = t;

            TypeModule = new ModuleDescriptor(t.Module);

            if(UnderlyingType.IsGenericType && !Helpers.IsOpenGenericType(UnderlyingType))
            {
                GenericFullName = UnderlyingType.GetGenericTypeDefinition().FullName;
                Name = UnderlyingType.GetGenericTypeDefinition().AssemblyQualifiedName;
            }
            else
            {
                Name = UnderlyingType.AssemblyQualifiedName;
                GenericFullName = UnderlyingType.FullName;
            }

            if(t.BaseType != null)
            {
                baseType = t.BaseType;
            }

            var fieldsToDeserialize = new List<FieldInfoOrEntryToOmit>();
            foreach(var field in StampHelpers.GetFieldsInSerializationOrder(UnderlyingType, true))
            {
                fieldsToDeserialize.Add(new FieldInfoOrEntryToOmit(field));
                if(!field.IsTransient())
                {
                    fields.Add(new FieldDescriptor(field));
                }
            }
            FieldsToDeserialize = fieldsToDeserialize;
        }