public DownloadSourceMetaDataCollection(DownloadSourceCollection parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            m_Parent  = parent;
            m_IsReady = true;
        }
        public DownloadSourceMetaDataCollection(DownloadSourceCollection parent, IEnumerable <KeyValuePair <string, string> > collection)
            : base(collection)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            m_Parent  = parent;
            m_IsReady = true;
        }
Пример #3
0
            public Source(DownloadSourceCollection parent, byte[] peerID, byte[] sectorsMap)
            {
                if (parent == null)
                {
                    throw new ArgumentNullException("parent");
                }
                if (peerID == null)
                {
                    throw new ArgumentNullException("peerID");
                }
                if (peerID.Length != 48)
                {
                    throw new ArgumentException();
                }

                m_MetaData     = new DownloadSourceMetaDataCollection(parent);
                m_PeerID       = peerID;
                m_PeerIDString = Core.ByteArrayToString(m_PeerID);
                m_SectorsMap   = sectorsMap;
            }
Пример #4
0
            public Source(DownloadSourceCollection parent, byte[] peerID, string fileName, RIndexedHashtable <string, string> metaData, string comment, byte rating, byte[] sectorsMap)
            {
                if (parent == null)
                {
                    throw new ArgumentNullException("parent");
                }
                if (peerID == null)
                {
                    throw new ArgumentNullException("peerID");
                }
                if (peerID.Length != 48)
                {
                    throw new ArgumentException();
                }
                if (fileName == null)
                {
                    throw new ArgumentNullException("fileName");
                }
                if (metaData == null)
                {
                    throw new ArgumentNullException("metaData");
                }
                if (comment == null)
                {
                    throw new ArgumentNullException("comment");
                }
                if (rating > 3)
                {
                    throw new ArgumentOutOfRangeException("rating");
                }

                m_MetaData       = new DownloadSourceMetaDataCollection(parent, metaData);
                m_PeerID         = peerID;
                m_PeerIDString   = Core.ByteArrayToString(m_PeerID);
                m_FileName       = fileName;
                m_MetaData       = new DownloadSourceMetaDataCollection(parent, metaData);
                m_Comment        = comment;
                m_Rating         = rating;
                m_SectorsMap     = sectorsMap;
                m_HasInformation = true;
            }