static string GetCSDefaultValue(Field f)
{
switch (f.ProtoType) {
case ProtoTypes.Double:
case ProtoTypes.Float:
case ProtoTypes.Fixed32:
case ProtoTypes.Fixed64:
case ProtoTypes.Sfixed32:
case ProtoTypes.Sfixed64:
case ProtoTypes.Int32:
case ProtoTypes.Int64:
case ProtoTypes.Uint32:
case ProtoTypes.Uint64:
case ProtoTypes.Sint32:
case ProtoTypes.Sint64:
case ProtoTypes.Bool:
return f.OptionDefault;
case ProtoTypes.String:
return f.OptionDefault;
case ProtoTypes.Bytes:
throw new NotImplementedException ();
case ProtoTypes.Enum:
return f.OptionDefault;
case ProtoTypes.Message:
throw new InvalidDataException ("Don't think there can be a default for messages");
default:
throw new NotImplementedException ();
}
}