Beispiel #1
0
        public void ManuallyWrittenSerializeCallbackStructSimple(CallbackStructSimple obj, ProtoWriter writer)
        {
            obj.OnSerializing();
            string bar = obj.Bar;

            if (bar != null)
            {
                ProtoWriter.WriteFieldHeader(1, WireType.String, writer);
                ProtoWriter.WriteString(bar, writer);
            }
            obj.OnSerialized();
        }
#pragma warning disable IDE0051 // Remove unused private members
        private void ManuallyWrittenSerializeCallbackStructSimple(CallbackStructSimple obj, ref ProtoWriter.State state)
#pragma warning restore IDE0051 // Remove unused private members
        {
            obj.OnSerializing();
            string bar = obj.Bar;

            if (bar != null)
            {
                state.WriteFieldHeader(1, WireType.String);
                state.WriteString(bar);
            }
            obj.OnSerialized();
        }