/// <summary> /// </summary> public Packet( FooEnum aFooEnum, Foo foo ) : this() { AFooEnum = aFooEnum; Foo = foo; }
public void ParseFrom(byte[] buffer, int offset, int size) { if (buffer == null) return; ProtoBufferReader reader = new ProtoBufferReader(buffer,offset,size); foreach (ProtoBufferObject obj in reader.ProtoBufferObjs) { switch (obj.FieldNumber) { case 1: AFooEnum = (FooEnum)((int)obj.Value); break; case 2: Foo = new Foo(); Foo.ParseFrom(obj.Value); break; case 3: ValueList.Add(obj.Value); break; default: break; } } CheckRequiredFields(); }