public string GetName(Type type, Property property) { string fullyQualifiedName = (type ?? throw new ArgumentNullException(nameof(type))).FullyQualifiedName; string propertyName = (property ?? throw new ArgumentNullException(nameof(property))).Name; // We can't look up the property name in _types, because it might belong to a base type that hasn't been parsed yet. return(NameUtils.ConvertPropertyName(propertyName)); }
public ClassTypeMetadata(ClassType type, Assembly assembly) : base(type, assembly) { IDictionary <string, string> memberNames = new Dictionary <string, string>(); foreach (Method method in type.Methods ?? Enumerable.Empty <Method>()) { memberNames[method.Name] = NameUtils.ConvertMethodName(method.Name); } foreach (Property property in type.Properties ?? Enumerable.Empty <Property>()) { memberNames[property.Name] = NameUtils.ConvertPropertyName(property.Name); } MemberNames = new ReadOnlyDictionary <string, string>(memberNames); Name = NameUtils.ConvertTypeName(type.Name); }
public InterfaceTypeMetadata(InterfaceType type, Assembly assembly) : base(type, assembly) { IDictionary <string, string> memberNames = new Dictionary <string, string>(); foreach (Method method in type.Methods ?? Enumerable.Empty <Method>()) { memberNames[method.Name] = NameUtils.ConvertMethodName(method.Name); } foreach (Property property in type.Properties ?? Enumerable.Empty <Property>()) { memberNames[property.Name] = NameUtils.ConvertPropertyName(property.Name); } MemberNames = new ReadOnlyDictionary <string, string>(memberNames); string name = NameUtils.ConvertTypeName(type.Name); Name = $"I{name}"; ProxyName = $"{name}Proxy"; DefaultName = name; }