/// <summary>Tests if this TypeIdentifier is considered equal to another.</summary> /// <param name="other">The type identifier to compare to this object.</param> /// <returns>True if the objects are considered equal, false if they are not.</returns> public bool Equals(TypeIdentifier other) { if (other == null) { return(false); } return(EqualityComparer <string> .Default.Equals(Namespace, other.Namespace) && m_nestedTypeName.SequenceEqual(other.m_nestedTypeName) && (m_genericArguments == null && other.m_genericArguments == null || m_genericArguments != null && m_genericArguments.SequenceEqual(other.m_genericArguments)) && TypeSpecifiers.SequenceEqual(other.TypeSpecifiers) && (AssemblyName == null && other.AssemblyName == null || AssemblyName != null && AssemblyName.FullName.Equals(other.AssemblyName?.FullName))); }
/// <summary> /// Gets element type of this type if this type is an array, pointer or reference. Returns /// <see langword="null"/> otherwise. /// </summary> public TypeIdentifier GetElementType() { if (TypeSpecifiers.Count == 0) { return(null); } return(new TypeIdentifier(Namespace, new List <string>(m_nestedTypeName), TypeSpecifiers.Take(TypeSpecifiers.Count - 1).ToList(), CloneGenericArguments(m_genericArguments), AssemblyName)); }