Exemple #1
0
        public ServiceGenInfo(ServiceDeclaration service, OutputOption outputOption, ProtoFile proto)
        {
            Service = service;

            Name      = service.Name.Pascal();
            Namespace = $"{proto.Option.Namespace}.{outputOption.Namespace ?? "Services"}";
        }
Exemple #2
0
 public EnumInfo(EnumDeclaration @enum, OutputOption outputOption, ProtoFile proto)
 {
     Enum      = @enum;
     Name      = @enum.Name.Pascal();
     Fields    = @enum.Members.ToDictionary(x => x.Name, x => new EnumMemberInfo(x));
     Namespace = $"{proto.Option.Namespace}.{outputOption.Namespace ?? "Models"}";
 }
 public MessageClassInfo(MessageDeclaration msg, OutputOption outputOption, ProtoFile proto)
 {
     this._msg = msg;
     Name      = msg.Name.Pascal();
     Namespace = $"{proto.Option.Namespace}.{outputOption.Namespace ?? "Models"}";
     _fields   = new SortedList <string, MessageFieldInfo>();
     foreach (var item in msg.Fields.Select(x => new MessageFieldInfo(x)))
     {
         _fields.Add(item.Field.Name, item);
     }
 }