예제 #1
0
        static void addSchema(Type GroupType, MessageAttribute messageAttr)
        {
            if (groupMap.ContainsKey(GroupType.Name))
            {
                throw new Exception($"Group name {GroupType.Name} is duplicated.");
            }

            GroupSchema group = new GroupSchema(GroupType, messageAttr);

            groupMap.Add(group.Name, group);
        }
예제 #2
0
        public GroupSchema(Type type, MessageAttribute messageAttr)
        {
            Name = type.Name;
            dependencies_type = messageAttr.dependencies;

            foreach (var msgType in type.GetNestedTypes())
            {
                if (msgType.IsEnum)
                {
                    addEnumType(msgType);
                }
                else
                {
                    addMessageType(msgType);
                }
                havingTypes.Add(msgType);
            }
        }