Exemplo n.º 1
0
 public ZField(string fieldName, int index, string cSharpType, ZFieldOptions options, WireType wireType, SerializationImplementation serializationImplementation)
 {
     FieldName  = fieldName;
     Index      = index;
     CSharpType = cSharpType;
     Options    = options;
     WireType   = wireType;
     SerializationImplementation = serializationImplementation;
 }
Exemplo n.º 2
0
        public static ZField From(this FieldDescriptorProto proto, string @namespace)
        {
            var fieldName  = proto.Name.Pascalize();
            var index      = proto.Number;
            var cSharpType = proto.ToSourceType(@namespace);

            var options = new ZFieldOptions
            {
                Deprecated = proto.Options?.Deprecated == true ? true : false
            };

            var wireType = proto.ToWireType();
            var serializationImplementation = proto.ToSerializationImplementation();

            return(new ZField(fieldName, index, cSharpType, options, wireType, serializationImplementation));
        }