protected virtual void MarkCachedMember(DefMember m) { if (m.IsStatic || AllowCachedMemberFields) { _cachedMembers.Add(m); } }
private void AddAttributesInMember(DefMember member, XmlElement elem) { foreach (XmlAttribute attr in elem.Attributes) { if (attr.Name != "name") { AddAttributeInHolder(member, CreateAttribute(attr)); } } foreach (XmlNode child in elem.ChildNodes) { if (!(child is XmlElement)) { continue; } if (child.Name[0] == '_') { AddAttributeInHolder(member, CreateAttribute(child as XmlElement)); continue; } switch (child.Name) { case "param": if (!(member is DefFunction)) { throw new Exception("Unexpected"); } string name = (child as XmlElement).GetAttribute("name"); DefParam param = null; foreach (DefParam p in (member as DefFunction).Parameters) { if (p.Name == name) { param = p; break; } } if (param == null) { throw new Exception("Wrong param name"); } foreach (XmlAttribute attr in child.Attributes) { if (attr.Name != "name") { AddAttributeInHolder(param, CreateAttribute(attr)); } } break; default: throw new Exception("Unexpected"); } } }
protected virtual string NameToPrivate(DefMember m) { string name = m.Name; if (m is DefFunction && (m as DefFunction).IsGetProperty && name.StartsWith("get")) { name = name.Substring(3); } return(NameToPrivate(name)); }