public bool Equals(EcmaDesc other) { if (other == null) { return(false); } if (NestedType == null ^ other.NestedType == null || ArrayDimensions == null ^ other.ArrayDimensions == null || GenericTypeArguments == null ^ other.GenericTypeArguments == null || GenericMemberArguments == null ^ other.GenericMemberArguments == null || MemberArguments == null ^ other.MemberArguments == null || ExplicitImplMember == null ^ other.ExplicitImplMember == null) { return(false); } return(other != null && DescKind == other.DescKind && TypeName == other.TypeName && Namespace == other.Namespace && MemberName == other.MemberName && (NestedType == null || NestedType.Equals(other.NestedType)) && (ArrayDimensions == null || ArrayDimensions.SequenceEqual(other.ArrayDimensions)) && (GenericTypeArguments == null || GenericTypeArguments.SequenceEqual(other.GenericTypeArguments)) && (GenericMemberArguments == null || GenericMemberArguments.SequenceEqual(other.GenericMemberArguments)) && (MemberArguments == null || MemberArguments.SequenceEqual(other.MemberArguments)) && Etc == other.Etc && EtcFilter == other.EtcFilter && (ExplicitImplMember == null || ExplicitImplMember.Equals(other.ExplicitImplMember))); }
public override string ToString() { return(string.Format("({8}) {0}::{1}{2}{3}{7} {4}{5}{6} {9}", Namespace, TypeName, FormatGenericArgsFull(GenericTypeArguments), NestedType != null ? "+" + NestedType.ToString() : string.Empty, MemberName ?? string.Empty, FormatGenericArgsFull(GenericMemberArguments), MemberArguments != null ? "(" + string.Join(",", MemberArguments.Select(m => m.ToString())) + ")" : string.Empty, ArrayDimensions != null && ArrayDimensions.Count > 0 ? ArrayDimensions.Select(dim => "[" + new string (',', dim - 1) + "]").Aggregate(string.Concat) : string.Empty, DescKind.ToString()[0], Etc != 0 ? '(' + Etc.ToString() + ')' : string.Empty)); }
// Returns the member name with its generic types if existing public string ToCompleteMemberName(Format format) { /* We special process two cases: * - Explicit member implementation which append a full type specification * - Conversion operator which are exposed as normal method but have specific captioning in the end */ if (ExplicitImplMember != null) { var impl = ExplicitImplMember; return(impl.FormattedNamespace + impl.ToCompleteTypeName() + "." + impl.ToCompleteMemberName(format)); } else if (format == Format.WithArgs && DescKind == Kind.Operator && MemberName.EndsWith("Conversion")) { var type1 = MemberArguments[0].FormattedNamespace + MemberArguments[0].ToCompleteTypeName() + ModToString(MemberArguments[0]); var type2 = MemberArguments[1].FormattedNamespace + MemberArguments[1].ToCompleteTypeName() + ModToString(MemberArguments[1]); return(type1 + " to " + type2); } var result = IsEtc && !string.IsNullOrEmpty(EtcFilter) ? EtcFilter : MemberName; // Temporary hack for monodoc produced inner type ctor if (DescKind == Kind.Constructor && NestedType != null) { result = ToCompleteTypeName(); } if (GenericMemberArguments != null) { result += FormatGenericArgs(GenericMemberArguments); } if (format == Format.WithArgs) { result += '('; if (MemberArguments != null && MemberArguments.Count > 0) { var args = MemberArguments.Select(a => FormatNamespace(a) + a.ToCompleteTypeName('+') + ModToString(a)); result += string.Join(",", args); } result += ')'; } return(result); }