示例#1
0
        public EnumTypeMetadata(EnumType type, Assembly assembly)
            : base(type, assembly)
        {
            IDictionary <string, string> memberNames = new Dictionary <string, string>();

            foreach (EnumMember member in type.Members ?? Enumerable.Empty <EnumMember>())
            {
                memberNames[member.Name] = NameUtils.ConvertEnumMemberName(member.Name);
            }

            MemberNames = new ReadOnlyDictionary <string, string>(memberNames);
            Name        = NameUtils.ConvertTypeName(type.Name);
        }
示例#2
0
        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);
        }
示例#3
0
        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;
        }