public MethodDeclaration Find(string name, bool throwIfMissing = false) { foreach (var method in this) { if (method.Name == name) { return(method); } } if (throwIfMissing) { throw new CodeModelException(string.Format(SR.MethodNotFound, _type.ToString(), name)); } return(null); }
public PropertyDeclaration Find(string name, bool throwIfMissing = false) { foreach (var property in this) { if (property.Name == name) { return(property); } } if (throwIfMissing) { throw new CodeModelException(string.Format(SR.PropertyNotFound, _type.ToString(), name)); } return(null); }
public EventDeclaration Find(string name, bool throwIfMissing = false) { foreach (var eventDecl in this) { if (eventDecl.Name == name) { return(eventDecl); } } if (throwIfMissing) { throw new CodeModelException(string.Format(SR.EventNotFound, _type.ToString(), name)); } return(null); }