Пример #1
0
        private Proto.Msg.Gossip GossipToProto(Gossip gossip)
        {
            var proto = new Proto.Msg.Gossip
            {
                SendBack = gossip.SendBack
            };

            foreach (var entry in gossip.UpdatedData)
            {
                proto.Entries.Add(new Proto.Msg.Gossip.Types.Entry
                {
                    Key      = entry.Key,
                    Envelope = DataEnvelopeToProto(entry.Value)
                });
            }

            if (gossip.ToSystemUid.HasValue)
            {
                proto.HasToSystemUid = true;
                proto.ToSystemUid    = gossip.ToSystemUid.Value;
            }

            if (gossip.FromSystemUid.HasValue)
            {
                proto.HasFromSystemUid = true;
                proto.FromSystemUid    = gossip.FromSystemUid.Value;
            }

            return(proto);
        }
Пример #2
0
        private Proto.Msg.Gossip GossipToProto(Gossip gossip)
        {
            var proto = new Proto.Msg.Gossip
            {
                SendBack = gossip.SendBack
            };

            foreach (var entry in gossip.UpdatedData)
            {
                proto.Entries.Add(new Proto.Msg.Gossip.Types.Entry
                {
                    Key      = entry.Key,
                    Envelope = DataEnvelopeToProto(entry.Value)
                });
            }

            return(proto);
        }