Пример #1
0
    public void MergeFrom(CounterEvent other)
    {
        if (other == null)
        {
            return;
        }
        if (other.Id.Length != 0)
        {
            Id = other.Id;
        }
        if (other.Version != 0UL)
        {
            Version = other.Version;
        }
        switch (other.EventCase)
        {
        case EventOneofCase.Added:
            if (Added == null)
            {
                Added = new global::CounterAdded();
            }
            Added.MergeFrom(other.Added);
            break;

        case EventOneofCase.Decremented:
            if (Decremented == null)
            {
                Decremented = new global::CounterDecremented();
            }
            Decremented.MergeFrom(other.Decremented);
            break;

        case EventOneofCase.Incremented:
            if (Incremented == null)
            {
                Incremented = new global::CounterIncremented();
            }
            Incremented.MergeFrom(other.Incremented);
            break;

        case EventOneofCase.NameChanged:
            if (NameChanged == null)
            {
                NameChanged = new global::CounterNameChanged();
            }
            NameChanged.MergeFrom(other.NameChanged);
            break;

        case EventOneofCase.Removed:
            if (Removed == null)
            {
                Removed = new global::CounterRemoved();
            }
            Removed.MergeFrom(other.Removed);
            break;
        }

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