public Resource(ulong __resourceID, Constants.ResourceType __type, uint __tokens, long __size, string __description, string __name, string __location, InformationEntropy[] __IE, object __data) { header = new ResourceHeader(__resourceID, __type, __tokens, __size, __description, __name, __location); IE = __IE; data = __data; }
public Download(Peer __peer, RingInfo __ringInfo, ResourceHeader __header, UICallBack __UIHandler) { peer = __peer; ringInfo = __ringInfo; header = __header; //REVISIT: make sure there is enough room for meta data. Also if very large you want to split up into a list of //buffers or circular buffer where the buffer is written to temp file at milestones. buffer = new byte[header.size]; bytesRead = 0; UIHandler = __UIHandler; }
public bool Download(Peer peer, RingInfo ringInfo, ResourceHeader resourceHeader, UICallBack UIHndlr) { Download download = new Download(peer, ringInfo, resourceHeader, UIHndlr); int downloadIndex = Add(download); if (downloadIndex < 0) { Queue(download); return false; } Download_Internal(download); return true; }
public Resource(ResourceHeader __header) { header = __header; }
public Resource() { header = new ResourceHeader(0,Constants.ResourceType.UNKNOWN_RESOURCE_TYPE,0,0,"", "unknown", ""); }
public void showQueryHit(RingInfo ringInfo, Peer hitPeer, ResourceHeader resourceHeader) { DataRow dr = queryResultsTable.NewRow(); dr[0] = hitPeer.userInfo.nickname; dr[1] = resourceHeader.resourceID; dr[2] = resourceHeader.name; dr[3] = resourceHeader.size; dr[4] = ""; dr[5] = hitPeer; dr[6] = ringInfo; dr[7] = resourceHeader; this.queryResultsTable.Rows.Add(dr); }
public void RetreiveResource(Peer peer, RingInfo ringInfo, ResourceHeader resourceHeader, UICallBack UIHndlr) { downloadManager.Download(peer, ringInfo, resourceHeader, UIHndlr); }