private void EnumValueDescriptorProto(uint totalLength, EnumValueDescriptor ed)
{
intend++;
while (totalLength != 0)
{
int type, no;
var l = GetTypeAndFieldNo(out type, out no);
ix += l;
totalLength -= (uint)l;
switch (no)
{
case 1: // string name
{
uint length;
var ixl = GetVarint(out length);
ix += ixl;
totalLength -= (uint)ixl;
ed.Name = GetString(length);
Write(string.Format("Type = {0}, F#= {1}, Length = {2}, Name = {3}", type, no, length, ed.Name));
ix += (int)length;
totalLength -= length;
break;
}
case 2: // string number
{
uint value;
var ixl = GetVarint(out value);
ix += ixl;
totalLength -= (uint)ixl;
ed.Number = (int)value;
Write(string.Format("Type = {0}, F#= {1}, Length = {2}, Number = {3}", type, no, ixl, value));
break;
}
case 3: // EnumValueOptions options
{
uint length;
var ixl = GetVarint(out length);
ix += ixl;
totalLength -= (uint)ixl;
Write(string.Format("Type = {0}, F#= {1}, Length = {2} - EnumValueOptions", type, no, length));
if (ed.Options == null)
{
ed.Options = new EnumValueOptions();
}
EnumValueOptions(length, ed.Options);
totalLength -= length;
break;
}
}
}
intend--;
}