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));
        }
        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);
        }