Ejemplo n.º 1
0
        protected DownloadRequest_Folder FolderRequestPrepend(LLUUID folderID, bool recurse, bool fetchFolders, bool fetchItems, string requestName)
        {
            DownloadRequest_Folder dr = new DownloadRequest_Folder(folderID, recurse, fetchFolders, fetchItems, requestName);

            // Prepend the request at the head of the queue
            lock (FolderRequests)
            {
                if (FolderRequests.Contains(dr))
                {
                    foreach (DownloadRequest_Folder existing in FolderRequests)
                    {
                        if (dr.Equals(existing))
                        {
                            dr = existing;
                            break;
                        }
                    }

                    LogDescendantQueueEvent("Append(returned existing): " + dr.ToString());
                }
                else
                {
                    FolderRequests.Insert(0, dr);
                    LogDescendantQueueEvent("Prepend: " + dr.ToString());
                }
            }
            return dr;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Append a request to the end of the queue.
        /// </summary>
        internal DownloadRequest_Folder FolderRequestAppend(LLUUID folderID, bool recurse, bool fetchFolders, bool fetchItems, string requestName)
        {

            DownloadRequest_Folder dr = new DownloadRequest_Folder(folderID, recurse, fetchFolders, fetchItems, requestName);

            // Add new request to the tail of the queue
            lock (FolderRequests)
            {
                if (FolderRequests.Contains(dr))
                {
                    foreach (DownloadRequest_Folder existing in FolderRequests)
                    {
                        if (dr.Equals(existing))
                        {
                            dr = existing;
                            break;
                        }
                    }
                    LogDescendantQueueEvent("Append(returned existing): " + dr.ToString());
                }
                else
                {
                    FolderRequests.Add(dr);
                    LogDescendantQueueEvent("Append: " + dr.ToString());
                }
            }

            FolderRequestBegin();
            return dr;
        }