コード例 #1
0
        public OfflineMessagesConcurent(OfflineMessagesConcurent messages)
        {
            if (messages == null)
            {
                return;
            }

            ReceiverLogin = new string(ReceiverLogin.ToCharArray());
            MessagesF     =
                new ConcurrentDictionary <string, ConcurrentBag <byte[]> >(MessagesF.ToDictionary(pair => pair.Key,
                                                                                                  pair => pair.Value));
        }
コード例 #2
0
        public OfflineMessagesConcurent Clone(bool deepClone)
        {
            OfflineMessagesConcurent offlineMessagesConcurent;

            if (deepClone)
            {
                offlineMessagesConcurent = new OfflineMessagesConcurent(new string(ReceiverLogin.ToCharArray()))
                {
                    MessagesF =
                        new ConcurrentDictionary <string, ConcurrentBag <byte[]> >(MessagesF.ToDictionary(pair => pair.Key,
                                                                                                          pair => pair.Value))
                };
            }
            else
            {
                offlineMessagesConcurent = new OfflineMessagesConcurent(ReceiverLogin)
                {
                    MessagesF = MessagesF
                };
            }
            return(offlineMessagesConcurent);
        }