heweitykc / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
0 stars 0 forks source link

Too many arguments expection when defining ProtoMember with optional arguments on Visual Basic #239

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new VisualBasic project
2. Type this:
Imports ProtoBuf
<ProtoContract()> _
Class Records
    <ProtoMember(1, DataFormat.ZigZag)> Public id As Int64
End Class

What is the expected output? What do you see instead?
I want do decode a SInt64-Value. With only "<ProtoMember(1)>" the 
wrong/"ZigZagged" value is returned. But with "<ProtoMember(1, 
DataFormat.ZigZag)>" I get a "Too many arguments" expection from the Visual 
Basic editor.

What version of the product are you using? On what operating system?
- VisualBasic 2008/2010
- protobuf-net-VS10.msi

Please provide any additional information below.
My email address: maikstoeckmann@web.de

Original issue reported on code.google.com by maikstoe...@googlemail.com on 4 Oct 2011 at 2:04

GoogleCodeExporter commented 9 years ago
DataFormat is a named (rather than positional) member; I am not a VB expert, 
but in C# the syntax would be

    [ProtoMember(1, DataFormat = DataFormat.ZigZag)]

This then seems to be a VB syntax question. I can try to find the correct 
syntax if you want.

Original comment by marc.gravell on 4 Oct 2011 at 4:05

GoogleCodeExporter commented 9 years ago
Oh, it would be great if you could find the correct syntax for me! But I am not 
sure that named members can ever be addressed this way within VB.

Original comment by maikstoe...@googlemail.com on 4 Oct 2011 at 4:33

GoogleCodeExporter commented 9 years ago
Please excuse the circumstances! I have found the correct syntax now:

<ProtoMember(1, DataFormat:=DataFormat.ZigZag)>

Best greetings!

Original comment by maikstoe...@googlemail.com on 4 Oct 2011 at 4:44