Пример #1
0
    public void MergeFrom(ServerMessage other)
    {
        if (other == null)
        {
            return;
        }
        switch (other.MessageCase)
        {
        case MessageOneofCase.ArduinoConnectedMessage:
            if (ArduinoConnectedMessage == null)
            {
                ArduinoConnectedMessage = new global::ArduinoConnected();
            }
            ArduinoConnectedMessage.MergeFrom(other.ArduinoConnectedMessage);
            break;

        case MessageOneofCase.ClientConnectedMessage:
            if (ClientConnectedMessage == null)
            {
                ClientConnectedMessage = new global::ClientConnected();
            }
            ClientConnectedMessage.MergeFrom(other.ClientConnectedMessage);
            break;
        }

        _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }
Пример #2
0
    public void MergeFrom(pb::CodedInputStream input)
    {
        uint tag;

        while ((tag = input.ReadTag()) != 0)
        {
            switch (tag)
            {
            default:
                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                break;

            case 10: {
                global::ArduinoConnected subBuilder = new global::ArduinoConnected();
                if (messageCase_ == MessageOneofCase.ArduinoConnectedMessage)
                {
                    subBuilder.MergeFrom(ArduinoConnectedMessage);
                }
                input.ReadMessage(subBuilder);
                ArduinoConnectedMessage = subBuilder;
                break;
            }

            case 18: {
                global::ClientConnected subBuilder = new global::ClientConnected();
                if (messageCase_ == MessageOneofCase.ClientConnectedMessage)
                {
                    subBuilder.MergeFrom(ClientConnectedMessage);
                }
                input.ReadMessage(subBuilder);
                ClientConnectedMessage = subBuilder;
                break;
            }
            }
        }
    }