예제 #1
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 8: {
                    Ver = input.ReadInt32();
                    break;
                }

                case 18: {
                    DataTypeName = input.ReadString();
                    break;
                }

                case 26: {
                    DateTime = input.ReadString();
                    break;
                }

                case 34: {
                    if (samplingRate_ == null)
                    {
                        samplingRate_ = new global::Google.Protobuf.WellKnownTypes.DoubleValue();
                    }
                    input.ReadMessage(samplingRate_);
                    break;
                }

                case 42: {
                    SequenceNumber = input.ReadString();
                    break;
                }

                case 50: {
                    InstrumentationKey = input.ReadString();
                    break;
                }

                case 58: {
                    tags_.AddEntriesFrom(input, _map_tags_codec);
                    break;
                }

                case 66: {
                    global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Event subBuilder = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Event();
                    if (dataCase_ == DataOneofCase.Event)
                    {
                        subBuilder.MergeFrom(Event);
                    }
                    input.ReadMessage(subBuilder);
                    Event = subBuilder;
                    break;
                }

                case 74: {
                    global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Message subBuilder = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Message();
                    if (dataCase_ == DataOneofCase.Message)
                    {
                        subBuilder.MergeFrom(Message);
                    }
                    input.ReadMessage(subBuilder);
                    Message = subBuilder;
                    break;
                }

                case 82: {
                    global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Metric subBuilder = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Metric();
                    if (dataCase_ == DataOneofCase.Metric)
                    {
                        subBuilder.MergeFrom(Metric);
                    }
                    input.ReadMessage(subBuilder);
                    Metric = subBuilder;
                    break;
                }

                case 90: {
                    global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Exception subBuilder = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Exception();
                    if (dataCase_ == DataOneofCase.Exception)
                    {
                        subBuilder.MergeFrom(Exception);
                    }
                    input.ReadMessage(subBuilder);
                    Exception = subBuilder;
                    break;
                }

                case 98: {
                    global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Dependency subBuilder = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Dependency();
                    if (dataCase_ == DataOneofCase.Dependency)
                    {
                        subBuilder.MergeFrom(Dependency);
                    }
                    input.ReadMessage(subBuilder);
                    Dependency = subBuilder;
                    break;
                }

                case 106: {
                    global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Availability subBuilder = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Availability();
                    if (dataCase_ == DataOneofCase.Availability)
                    {
                        subBuilder.MergeFrom(Availability);
                    }
                    input.ReadMessage(subBuilder);
                    Availability = subBuilder;
                    break;
                }

                case 114: {
                    global::Microsoft.LocalForwarder.Library.Inputs.Contracts.PageView subBuilder = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.PageView();
                    if (dataCase_ == DataOneofCase.PageView)
                    {
                        subBuilder.MergeFrom(PageView);
                    }
                    input.ReadMessage(subBuilder);
                    PageView = subBuilder;
                    break;
                }

                case 122: {
                    global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Request subBuilder = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Request();
                    if (dataCase_ == DataOneofCase.Request)
                    {
                        subBuilder.MergeFrom(Request);
                    }
                    input.ReadMessage(subBuilder);
                    Request = subBuilder;
                    break;
                }
                }
            }
        }
예제 #2
0
        public void MergeFrom(Telemetry other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Ver != 0)
            {
                Ver = other.Ver;
            }
            if (other.DataTypeName.Length != 0)
            {
                DataTypeName = other.DataTypeName;
            }
            if (other.DateTime.Length != 0)
            {
                DateTime = other.DateTime;
            }
            if (other.samplingRate_ != null)
            {
                if (samplingRate_ == null)
                {
                    samplingRate_ = new global::Google.Protobuf.WellKnownTypes.DoubleValue();
                }
                SamplingRate.MergeFrom(other.SamplingRate);
            }
            if (other.SequenceNumber.Length != 0)
            {
                SequenceNumber = other.SequenceNumber;
            }
            if (other.InstrumentationKey.Length != 0)
            {
                InstrumentationKey = other.InstrumentationKey;
            }
            tags_.Add(other.tags_);
            switch (other.DataCase)
            {
            case DataOneofCase.Event:
                if (Event == null)
                {
                    Event = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Event();
                }
                Event.MergeFrom(other.Event);
                break;

            case DataOneofCase.Message:
                if (Message == null)
                {
                    Message = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Message();
                }
                Message.MergeFrom(other.Message);
                break;

            case DataOneofCase.Metric:
                if (Metric == null)
                {
                    Metric = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Metric();
                }
                Metric.MergeFrom(other.Metric);
                break;

            case DataOneofCase.Exception:
                if (Exception == null)
                {
                    Exception = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Exception();
                }
                Exception.MergeFrom(other.Exception);
                break;

            case DataOneofCase.Dependency:
                if (Dependency == null)
                {
                    Dependency = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Dependency();
                }
                Dependency.MergeFrom(other.Dependency);
                break;

            case DataOneofCase.Availability:
                if (Availability == null)
                {
                    Availability = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Availability();
                }
                Availability.MergeFrom(other.Availability);
                break;

            case DataOneofCase.PageView:
                if (PageView == null)
                {
                    PageView = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.PageView();
                }
                PageView.MergeFrom(other.PageView);
                break;

            case DataOneofCase.Request:
                if (Request == null)
                {
                    Request = new global::Microsoft.LocalForwarder.Library.Inputs.Contracts.Request();
                }
                Request.MergeFrom(other.Request);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }