syntax = "proto3";
message ProxyMessage {
int32 Signal = 1;
oneof payload
{
repeated int32 a= 6;
repeated float b = 7;
}
}
syntax = "proto3";
message A
{
repeated int32 Int32Parameters = 1;
}
message B
{
repeated float FloatParameters = 1;
}
message ProxyMessage {
int32 Signal = 1;
oneof payload
{
A a= 6;
B b = 7;
}
}
public MainPage()
{
this.InitializeComponent();
RepeatedField<int> myInts = new RepeatedField<int>();
myInts.Add(2);
myInts.Add(3);
ProxyMessage proxy = new ProxyMessage();
proxy.Signal = 5;
proxy.A.Int32Parameters.AddRange(myInts);
}
proxy.PayloadCase = ProxyMessage.PayloadOneofCase.A;
but this will not compile with "..can not assigned to --it is read only"
any ideas?
Dave
required
, optional
, or repeated
keywords.repeated
.--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
simple resolution to the second issue ...forgot the proxy.A = new A();