本文整理汇总了C#中IInventoryService.GetRootFolders方法的典型用法代码示例。如果您正苦于以下问题:C# IInventoryService.GetRootFolders方法的具体用法?C# IInventoryService.GetRootFolders怎么用?C# IInventoryService.GetRootFolders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IInventoryService
的用法示例。
在下文中一共展示了IInventoryService.GetRootFolders方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInventoryLibrary
/// <summary>
/// Converts the inventory library skeleton into the form required by the rpc request.
/// </summary>
/// <returns></returns>
protected virtual ArrayList GetInventoryLibrary(ILibraryService library, IInventoryService inventoryService)
{
ArrayList AgentInventoryArray = new ArrayList();
List<InventoryFolderBase> rootFolders = inventoryService.GetRootFolders(library.LibraryOwner);
Hashtable RootHash = new Hashtable();
RootHash["name"] = library.LibraryName;
RootHash["parent_id"] = UUID.Zero.ToString();
RootHash["version"] = (Int32)1;
RootHash["type_default"] = (Int32)9;
RootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
AgentInventoryArray.Add(RootHash);
List<UUID> rootFolderUUIDs = new List<UUID>();
foreach (InventoryFolderBase rootFolder in rootFolders)
{
if (rootFolder.Name != "My Inventory")
rootFolderUUIDs.Add(rootFolder.ID);
}
if (rootFolderUUIDs.Count != 0)
{
foreach (UUID rootfolderID in rootFolderUUIDs)
{
TraverseFolder(library.LibraryOwner, rootfolderID, inventoryService, true, ref AgentInventoryArray);
}
}
return AgentInventoryArray;
}
示例2: GetInventoryLibrary
/// <summary>
/// Converts the inventory library skeleton into the form required by the rpc request.
/// </summary>
/// <returns></returns>
protected virtual ArrayList GetInventoryLibrary(ILibraryService library, IInventoryService inventoryService)
{
ArrayList AgentInventoryArray = new ArrayList();
List<InventoryFolderBase> rootFolders = inventoryService.GetRootFolders(library.LibraryOwner);
Hashtable RootHash = new Hashtable();
RootHash["name"] = library.LibraryName;
RootHash["parent_id"] = UUID.Zero.ToString();
RootHash["version"] = 1;
RootHash["type_default"] = 8;
RootHash["folder_id"] = library.LibraryRootFolderID.ToString();
AgentInventoryArray.Add(RootHash);
List<UUID> rootFolderUUIDs =
(from rootFolder in rootFolders where rootFolder.Name != "My Inventory" select rootFolder.ID).ToList();
if (rootFolderUUIDs.Count != 0)
{
foreach (UUID rootfolderID in rootFolderUUIDs)
{
TraverseFolder(library.LibraryOwner, rootfolderID, inventoryService, library, true,
ref AgentInventoryArray);
}
}
return AgentInventoryArray;
}
示例3: GetInventorySkeleton
private InventoryData GetInventorySkeleton(ILibraryService library, IInventoryService inventoryService, List<InventoryFolderBase> folders)
{
UUID rootID = UUID.Zero;
ArrayList AgentInventoryArray = new ArrayList();
Hashtable TempHash;
foreach (InventoryFolderBase InvFolder in folders)
{
if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory")
{
rootID = InvFolder.ID;
}
TempHash = new Hashtable();
TempHash["name"] = InvFolder.Name;
TempHash["parent_id"] = InvFolder.ParentID.ToString();
TempHash["version"] = (Int32)InvFolder.Version;
TempHash["type_default"] = (Int32)InvFolder.Type;
TempHash["folder_id"] = InvFolder.ID.ToString();
AgentInventoryArray.Add(TempHash);
}
List<InventoryFolderBase> rootFolders = inventoryService.GetRootFolders(library.LibraryOwner);
Hashtable RootHash = new Hashtable();
RootHash["name"] = library.LibraryName;
RootHash["parent_id"] = UUID.Zero.ToString();
RootHash["version"] = (Int32)1;
RootHash["type_default"] = (Int32)9;
RootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
AgentInventoryArray.Add(RootHash);
List<UUID> rootFolderUUIDs = new List<UUID>();
foreach (InventoryFolderBase rootFolder in rootFolders)
{
if (rootFolder.Name != "My Inventory")
{
rootFolderUUIDs.Add(rootFolder.ID);
}
}
if (rootFolderUUIDs.Count != 0)
{
foreach (UUID rootfolderID in rootFolderUUIDs)
{
TraverseFolder(library.LibraryOwner, rootfolderID, inventoryService, true, ref AgentInventoryArray);
}
}
return new InventoryData(AgentInventoryArray, rootID);
}