Example #1
0
        public void MergeFrom(Event other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Created != 0L)
            {
                Created = other.Created;
            }
            if (other.Source.Length != 0)
            {
                Source = other.Source;
            }
            if (other.Instance.Length != 0)
            {
                Instance = other.Instance;
            }
            switch (other.MsgCase)
            {
            case MsgOneofCase.Ka:
                if (Ka == null)
                {
                    Ka = new global::Monik.Common.KeepAlive();
                }
                Ka.MergeFrom(other.Ka);
                break;

            case MsgOneofCase.Lg:
                if (Lg == null)
                {
                    Lg = new global::Monik.Common.Log();
                }
                Lg.MergeFrom(other.Lg);
                break;

            case MsgOneofCase.Pc:
                if (Pc == null)
                {
                    Pc = new global::Monik.Common.PerfCounter();
                }
                Pc.MergeFrom(other.Pc);
                break;

            case MsgOneofCase.Mc:
                if (Mc == null)
                {
                    Mc = new global::Monik.Common.Metric();
                }
                Mc.MergeFrom(other.Mc);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Example #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 8: {
                    Created = input.ReadSInt64();
                    break;
                }

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

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

                case 34: {
                    global::Monik.Common.KeepAlive subBuilder = new global::Monik.Common.KeepAlive();
                    if (msgCase_ == MsgOneofCase.Ka)
                    {
                        subBuilder.MergeFrom(Ka);
                    }
                    input.ReadMessage(subBuilder);
                    Ka = subBuilder;
                    break;
                }

                case 42: {
                    global::Monik.Common.Log subBuilder = new global::Monik.Common.Log();
                    if (msgCase_ == MsgOneofCase.Lg)
                    {
                        subBuilder.MergeFrom(Lg);
                    }
                    input.ReadMessage(subBuilder);
                    Lg = subBuilder;
                    break;
                }

                case 50: {
                    global::Monik.Common.PerfCounter subBuilder = new global::Monik.Common.PerfCounter();
                    if (msgCase_ == MsgOneofCase.Pc)
                    {
                        subBuilder.MergeFrom(Pc);
                    }
                    input.ReadMessage(subBuilder);
                    Pc = subBuilder;
                    break;
                }

                case 58: {
                    global::Monik.Common.Metric subBuilder = new global::Monik.Common.Metric();
                    if (msgCase_ == MsgOneofCase.Mc)
                    {
                        subBuilder.MergeFrom(Mc);
                    }
                    input.ReadMessage(subBuilder);
                    Mc = subBuilder;
                    break;
                }
                }
            }
        }