public void ImportOptionalModifierType() { var baseType = CreateTypeDefOrRef(typeof(Form)); var modifierType = CreateTypeReference(typeof(IsVolatile)); var modOptType = new OptionalModifierSignature(modifierType, baseType); var newType = TestTypeSpecification(modOptType, baseType.Type); Assert.NotSame(modifierType, newType.ModifierType); }
/// <summary> /// Determines whether two types are considered equal according to their signature. /// </summary> /// <param name="signature1">The first type to compare.</param> /// <param name="signature2">The second type to compare.</param> /// <returns><c>True</c> if the types are considered equal, <c>False</c> otherwise.</returns> public bool Equals(OptionalModifierSignature signature1, OptionalModifierSignature signature2) { if (signature1 == null && signature2 == null) { return(true); } if (signature1 == null || signature2 == null) { return(false); } return(Equals(signature1.ModifierType, signature2.ModifierType) && Equals(signature1.BaseType, signature2.BaseType)); }
private OptionalModifierSignature ImportOptionalModifierSignature(OptionalModifierSignature modOptType) { return(new OptionalModifierSignature(ImportType(modOptType.ModifierType), ImportTypeSignature(modOptType.BaseType))); }