當前位置: 首頁>>代碼示例>>C#>>正文


C# InventoryFolder.DownloadContents方法代碼示例

本文整理匯總了C#中OpenMetaverse.InventoryFolder.DownloadContents方法的典型用法代碼示例。如果您正苦於以下問題:C# InventoryFolder.DownloadContents方法的具體用法?C# InventoryFolder.DownloadContents怎麽用?C# InventoryFolder.DownloadContents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenMetaverse.InventoryFolder的用法示例。


在下文中一共展示了InventoryFolder.DownloadContents方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PrintFolder

 void PrintFolder(InventoryFolder folder, StringBuilder result, int indent)
 {
     folder.DownloadContents(TimeSpan.FromSeconds(10));
     foreach (InventoryBase b in folder)
     {
         if (b is InventoryFolder)
         {
             result.Append(Print(b as InventoryFolder, indent));
             PrintFolder(b as InventoryFolder, result, indent + 1);
         }
         else if (b is InventoryItem)
         {
             result.Append(Print(b as InventoryItem, indent));
         }
     }
 }
開發者ID:RavenB,項目名稱:gridsearch,代碼行數:16,代碼來源:InventoryCommand.cs

示例2: BackupFolder

        /// <summary>
        /// BackupFolder - recurse through the inventory nodes sending scripts and notecards to the transfer queue
        /// </summary>
        /// <param name="folder">The current leaf in the inventory tree</param>
        /// <param name="sPathSoFar">path so far, in the form @"c:\here" -- this needs to be "clean" for the current filesystem</param>
        private void BackupFolder(InventoryFolder folder, string sPathSoFar)
        {
            StringBuilder sbRequests = new StringBuilder();


            if (folder.IsStale)
                folder.DownloadContents(TimeSpan.FromSeconds(10));

            // first scan this folder for text

            foreach (InventoryBase ib in folder)
            {
                if (BackupWorker.CancellationPending)
                    return;
                if (ib is InventoryItem)
                {
                    InventoryItem ii = ib as InventoryItem;
                    if (ii.Data.AssetType == AssetType.LSLText || ii.Data.AssetType == AssetType.Notecard)
                    {
                        // check permissions on scripts
                        if (ii.Data.AssetType == AssetType.LSLText)
                        {
                            if ((ii.Data.Permissions.OwnerMask & PermissionMask.Modify) == PermissionMask.None)
                            {
                                // skip this one
                                continue;
                            }
                        }

                        string sExtension = (ii.Data.AssetType == AssetType.LSLText) ? ".lsl" : ".txt";
                        // make the output file
                        string sPath = sPathSoFar + @"\" + MakeValid(ii.Name.Trim()) + sExtension;

                        // create the new qdi
                        QueuedDownloadInfo qdi = new QueuedDownloadInfo(sPath, ii.Data.AssetUUID, ii.UUID, UUID.Zero, 
                            Client.Self.AgentID, ii.Data.AssetType);
                        
                        // add it to the queue
                        lock (PendingDownloads)
                        {
                            TextItemsFound++;
                            PendingDownloads.Enqueue(qdi);
                        }
                    }
                }
            }

            // now run any subfolders
            foreach (InventoryBase ib in folder)
            {
                if (BackupWorker.CancellationPending)
                    return;
                else if (ib is InventoryFolder)
                    BackupFolder(ib as InventoryFolder, sPathSoFar + @"\" + MakeValid(ib.Name.Trim()));
            }
        }
開發者ID:RavenB,項目名稱:gridsearch,代碼行數:61,代碼來源:BackupCommand.cs


注:本文中的OpenMetaverse.InventoryFolder.DownloadContents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。