示例#1
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);
        }
示例#2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ver != 0)
            {
                hash ^= Ver.GetHashCode();
            }
            if (DataTypeName.Length != 0)
            {
                hash ^= DataTypeName.GetHashCode();
            }
            if (DateTime.Length != 0)
            {
                hash ^= DateTime.GetHashCode();
            }
            if (samplingRate_ != null)
            {
                hash ^= SamplingRate.GetHashCode();
            }
            if (SequenceNumber.Length != 0)
            {
                hash ^= SequenceNumber.GetHashCode();
            }
            if (InstrumentationKey.Length != 0)
            {
                hash ^= InstrumentationKey.GetHashCode();
            }
            hash ^= Tags.GetHashCode();
            if (dataCase_ == DataOneofCase.Event)
            {
                hash ^= Event.GetHashCode();
            }
            if (dataCase_ == DataOneofCase.Message)
            {
                hash ^= Message.GetHashCode();
            }
            if (dataCase_ == DataOneofCase.Metric)
            {
                hash ^= Metric.GetHashCode();
            }
            if (dataCase_ == DataOneofCase.Exception)
            {
                hash ^= Exception.GetHashCode();
            }
            if (dataCase_ == DataOneofCase.Dependency)
            {
                hash ^= Dependency.GetHashCode();
            }
            if (dataCase_ == DataOneofCase.Availability)
            {
                hash ^= Availability.GetHashCode();
            }
            if (dataCase_ == DataOneofCase.PageView)
            {
                hash ^= PageView.GetHashCode();
            }
            if (dataCase_ == DataOneofCase.Request)
            {
                hash ^= Request.GetHashCode();
            }
            hash ^= (int)dataCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }