Exemplo n.º 1
0
            public void Report5354Received(string fileName, RIndexedHashtable <string, string> metaData, string comment, byte rating, byte[] sectorsMap)
            {
                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_FileName       = fileName;
                m_MetaData       = new DownloadSourceMetaDataCollection(m_MetaData.Parent, metaData);
                m_Comment        = comment;
                m_Rating         = rating;
                m_SectorsMap     = sectorsMap;
                m_HasInformation = true;
                m_LastReceived   = DateTime.Now;
            }
Exemplo n.º 2
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;
            }
Exemplo n.º 3
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;
            }