// remove static methods (T.ReferenceEquals() is not possible) public override List <IMethod> GetMethods() { List <IMethod> list = base.GetMethods(); if (list != null) { list.RemoveAll(delegate(IMethod m) { return(m.IsStatic || m.IsConstructor); }); if (_typeParameter.HasConstructableConstraint || _typeParameter.HasValueTypeConstraint) { list.Add(new Constructor(ModifierEnum.Public, this, DefaultTypeParameter.GetDummyClassForTypeParameter(_typeParameter))); } } return(list); }
public override bool Equals(object obj) { DefaultTypeParameter tp = obj as DefaultTypeParameter; if (tp == null) { return(false); } if (tp.index != index) { return(false); } if (tp.name != name) { return(false); } if (tp.hasConstructableConstraint != hasConstructableConstraint) { return(false); } if (tp.hasReferenceTypeConstraint != hasReferenceTypeConstraint) { return(false); } if (tp.hasValueTypeConstraint != hasValueTypeConstraint) { return(false); } if (tp.method != method) { if (tp.method == null || method == null) { return(false); } if (tp.method.FullyQualifiedName == method.FullyQualifiedName) { return(false); } } else { if (tp.targetClass.FullyQualifiedName == targetClass.FullyQualifiedName) { return(false); } } return(true); }
private static void AddTypeParametersForCtrlSpace(ArrayList result, IEnumerable <ITypeParameter> typeParameters) { foreach (ITypeParameter p in typeParameters) { DefaultClass c = DefaultTypeParameter.GetDummyClassForTypeParameter(p); if (p.Method != null) { c.Documentation = "Type parameter of " + p.Method.Name; } else { c.Documentation = "Type parameter of " + p.Class.Name; } result.Add(c); } }