本文整理汇总了C#中Aurora.Framework.InventoryFolderBase类的典型用法代码示例。如果您正苦于以下问题:C# InventoryFolderBase类的具体用法?C# InventoryFolderBase怎么用?C# InventoryFolderBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InventoryFolderBase类属于Aurora.Framework命名空间,在下文中一共展示了InventoryFolderBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateUserRootFolder
public virtual bool CreateUserRootFolder(UUID principalID)
{
bool result = false;
InventoryFolderBase rootFolder = GetRootFolder(principalID);
if (rootFolder == null)
{
List<InventoryFolderBase> rootFolders = GetInventorySkeleton(principalID);
if (rootFolders.Count == 0)
rootFolder = CreateFolder(principalID, UUID.Zero, (int) AssetType.RootFolder, "My Inventory");
else
{
rootFolder = new InventoryFolderBase
{
Name = "My Inventory",
Type = (short) AssetType.RootFolder,
Version = 1,
ID = rootFolders[0].ParentID,
Owner = principalID,
ParentID = UUID.Zero
};
m_Database.StoreFolder(rootFolder);
}
result = true;
}
return result;
}
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:30,代码来源:InventoryService.cs
示例2: InventoryFolderImpl
// Constructors
public InventoryFolderImpl(InventoryFolderBase folderbase)
{
Owner = folderbase.Owner;
ID = folderbase.ID;
Name = folderbase.Name;
ParentID = folderbase.ParentID;
Type = folderbase.Type;
Version = folderbase.Version;
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:10,代码来源:InventoryFolderImpl.cs
示例3: AddFolder
public override bool AddFolder(InventoryFolderBase folder)
{
string invserverURL = "";
if (GetHandlers.GetIsForeign (folder.Owner, "InventoryServerURI", m_registry, out invserverURL))
{
XInventoryServicesConnector xinv = new XInventoryServicesConnector (invserverURL + "xinventory");
return xinv.AddFolder (folder);
}
return base.AddFolder (folder);
}
开发者ID:djphil,项目名称:Aurora-HG-Plugin,代码行数:10,代码来源:HGInternalInventoryService.cs
示例4: AddFolder
public override bool AddFolder(InventoryFolderBase folder)
{
object remoteValue = DoRemote(folder);
if (remoteValue != null || m_doRemoteOnly)
return remoteValue != null && (bool)remoteValue;
string invserverURL = "";
if (GetHandlers.GetIsForeign (folder.Owner, "InventoryServerURI", m_registry, out invserverURL))
{
XInventoryServicesConnector xinv = new XInventoryServicesConnector (invserverURL + "xinventory");
return xinv.AddFolder (folder);
}
return base.AddFolder (folder);
}
开发者ID:JAllard,项目名称:HyperGrid,代码行数:14,代码来源:HGInternalInventoryService.cs
示例5: FromOSD
public override void FromOSD(OSDMap map)
{
OSDArray items = (OSDArray)map["Items"];
Items = items.ConvertAll<InventoryItemBase>((osd) =>
{
InventoryItemBase item = new InventoryItemBase();
item.FromOSD((OSDMap)osd);
return item;
}
);
OSDArray folders = (OSDArray)map["Folders"];
Folders = folders.ConvertAll<InventoryFolderBase>((osd) =>
{
InventoryFolderBase folder = new InventoryFolderBase();
folder.FromOSD((OSDMap)osd);
return folder;
}
);
UserID = map["UserID"];
}
开发者ID:Gnu32,项目名称:Silverfin,代码行数:20,代码来源:InventoryCollection.cs
示例6: AddFolder
public virtual bool AddFolder(InventoryFolderBase folder)
{
if (folder == null)
return false;
Dictionary<string, object> ret = MakeRequest("ADDFOLDER",
new Dictionary<string, object>
{
{"ParentID", folder.ParentID.ToString()},
{"Type", folder.Type.ToString()},
{"Version", folder.Version.ToString()},
{"Name", folder.Name},
{"Owner", folder.Owner.ToString()},
{"ID", folder.ID.ToString()}
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
开发者ID:KSLcom,项目名称:Aurora-HG-Plugin,代码行数:21,代码来源:XInventoryServicesConnector.cs
示例7: HandleMoveInventoryFolder
/// <summary>
/// Move the inventory folder to another place in the user's inventory
/// </summary>
/// <param name="remoteClient">The client that requested the change</param>
/// <param name="folderID">The folder UUID to move</param>
/// <param name="parentID">The folder to move the folder (folderID) into</param>
protected void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
{
InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
folder = m_scene.InventoryService.GetFolder(folder);
if (folder != null)
{
folder.ParentID = parentID;
if (!m_scene.InventoryService.MoveFolder(folder))
MainConsole.Instance.WarnFormat("[AGENT INVENTORY]: could not move folder {0}", folderID);
else
MainConsole.Instance.DebugFormat("[AGENT INVENTORY]: folder {0} moved to parent {1}", folderID, parentID);
}
else
{
MainConsole.Instance.WarnFormat("[AGENT INVENTORY]: request to move folder {0} but folder not found", folderID);
}
}
开发者ID:samiam123,项目名称:Aurora-Sim,代码行数:23,代码来源:LLClientInventory.cs
示例8: HandleCreateInventoryFolder
/// <summary>
/// Handle an inventory folder creation request from the client.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="folderID"></param>
/// <param name="folderType"></param>
/// <param name="folderName"></param>
/// <param name="parentID"></param>
protected void HandleCreateInventoryFolder(IClientAPI remoteClient, UUID folderID, ushort folderType,
string folderName, UUID parentID)
{
InventoryFolderBase folder = new InventoryFolderBase(folderID, folderName, remoteClient.AgentId, (short)folderType, parentID, 1);
if (!m_scene.InventoryService.AddFolder(folder))
{
MainConsole.Instance.WarnFormat(
"[AGENT INVENTORY]: Failed to create folder for user {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
开发者ID:samiam123,项目名称:Aurora-Sim,代码行数:19,代码来源:LLClientInventory.cs
示例9: SendInventoryUpdate
/// <summary>
/// Send an update to the client about the given folder
/// </summary>
/// <param name="client">The client to send the update to</param>
/// <param name="folder">The folder that we need to send</param>
/// <param name="fetchFolders">Should we fetch folders inside of this folder</param>
/// <param name="fetchItems">Should we fetch items inside of this folder</param>
protected void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems)
{
if (folder == null)
return;
// Fetch the folder contents
InventoryCollection contents = m_scene.InventoryService.GetFolderContent(client.AgentId, folder.ID);
// Fetch the folder itself to get its current version
InventoryFolderBase containingFolder = new InventoryFolderBase(folder.ID, client.AgentId);
containingFolder = m_scene.InventoryService.GetFolder(containingFolder);
//MainConsole.Instance.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}",
// contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName);
if (containingFolder != null)
client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, containingFolder.Version, fetchFolders, fetchItems);
}
开发者ID:samiam123,项目名称:Aurora-Sim,代码行数:25,代码来源:LLClientInventory.cs
示例10: NewFolder
private void NewFolder(UUID userID, string newFolderName, string folder)
{
UUID folderID = UUID.Zero;
if (UUID.TryParse(folder, out folderID))
{
InventoryFolderBase fbase = new InventoryFolderBase(UUID.Random(), newFolderName, userID, folderID);
fbase.Type = (short)AssetType.Folder;
m_InventoryService.AddFolder(fbase);
}
}
开发者ID:JAllard,项目名称:AuroraWeb,代码行数:10,代码来源:Services.Inventory.cs
示例11: Delete
private void Delete(UUID userID, List<string> nodes, List<string> types)
{
List<UUID> items = new List<UUID>();
List<UUID> folders = new List<UUID>();
SplitNodes(userID, nodes, types, items, folders);
var trash = m_InventoryService.GetFolderForType(userID, InventoryType.Folder, AssetType.TrashFolder);
if (trash != null)
{
List<InventoryItemBase> its = new List<InventoryItemBase>();
foreach (UUID uuid in items)
{
InventoryItemBase itbase = new InventoryItemBase();
itbase.ID = uuid;
itbase.Folder = UUID.Zero;
its.Add(itbase);
}
m_InventoryService.MoveItems(userID, its);
bool purgeTrash = false;
foreach (UUID uuid in folders)
{
InventoryFolderBase fbase = new InventoryFolderBase(uuid, userID);
//if (uuid == trash)
// purgeTrash = true;
//else
{
fbase.ParentID = UUID.Zero;
m_InventoryService.MoveFolder(fbase);
}
}
if (purgeTrash)
{
InventoryFolderBase fbase = new InventoryFolderBase(UUID.Zero, userID);
m_InventoryService.PurgeFolder(fbase);
}
}
}
开发者ID:JAllard,项目名称:AuroraWeb,代码行数:38,代码来源:Services.Inventory.cs
示例12: CreateArchiveFolderName
///<summary>
/// Create the archive name for a particular folder.
///</summary>
///These names are prepended with an inventory folder's UUID so that more than one folder can have the
///same name
///<param name = "folder"></param>
///<returns></returns>
public static string CreateArchiveFolderName(InventoryFolderBase folder)
{
return CreateArchiveFolderName(folder.Name, folder.ID);
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:11,代码来源:InventoryArchiveWriteRequest.cs
示例13: PurgeFolder
/// <summary>
/// Purge an inventory folder of all its items and subfolders.
/// </summary>
/// <param name = "folder"></param>
/// <returns>true if the folder was successfully purged</returns>
public bool PurgeFolder(InventoryFolderBase folder)
{
NameValueCollection requestArgs = new NameValueCollection
{
{"RequestMethod", "PurgeInventoryFolder"},
{"OwnerID", folder.Owner.ToString()},
{"FolderID", folder.ID.ToString()}
};
OSDMap response = WebUtils.PostToService(m_serverUrl, requestArgs);
bool success = response["Success"].AsBoolean();
if (!success)
{
MainConsole.Instance.Warn("[SIMIAN INVENTORY CONNECTOR]: Error purging folder " + folder.ID + " for " + folder.Owner +
": " +
response["Message"].AsString());
}
return success;
}
开发者ID:andsim,项目名称:Aurora-Sim-Optional-Modules,代码行数:26,代码来源:SimianInventoryServiceConnector.cs
示例14: GetFolder
/// <summary>
/// Get a folder, given by its UUID
/// </summary>
/// <param name = "folder"></param>
/// <returns></returns>
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
NameValueCollection requestArgs = new NameValueCollection
{
{"RequestMethod", "GetInventoryNode"},
{"ItemID", folder.ID.ToString()},
{"OwnerID", folder.Owner.ToString()},
{"IncludeFolders", "1"},
{"IncludeItems", "0"},
{"ChildrenOnly", "1"}
};
OSDMap response = WebUtils.PostToService(m_serverUrl, requestArgs);
if (response["Success"].AsBoolean() && response["Items"] is OSDArray)
{
OSDArray items = (OSDArray) response["Items"];
List<InventoryFolderBase> folders = GetFoldersFromResponse(items, folder.ID, true);
if (folders.Count > 0)
return folders[0];
}
return null;
}
开发者ID:andsim,项目名称:Aurora-Sim-Optional-Modules,代码行数:29,代码来源:SimianInventoryServiceConnector.cs
示例15: AddFolder
/// <summary>
/// Add a new folder to the user's inventory
/// </summary>
/// <param name = "folder"></param>
/// <returns>true if the folder was successfully added</returns>
public bool AddFolder(InventoryFolderBase folder)
{
NameValueCollection requestArgs = new NameValueCollection
{
{"RequestMethod", "AddInventoryFolder"},
{"FolderID", folder.ID.ToString()},
{"ParentID", folder.ParentID.ToString()},
{"OwnerID", folder.Owner.ToString()},
{"Name", folder.Name},
{"ContentType", SLUtil.SLAssetTypeToContentType(folder.Type)}
};
OSDMap response = WebUtils.PostToService(m_serverUrl, requestArgs);
bool success = response["Success"].AsBoolean();
if (!success)
{
MainConsole.Instance.Warn("[SIMIAN INVENTORY CONNECTOR]: Error creating folder " + folder.Name + " for " + folder.Owner +
": " +
response["Message"].AsString());
}
return success;
}
开发者ID:andsim,项目名称:Aurora-Sim-Optional-Modules,代码行数:29,代码来源:SimianInventoryServiceConnector.cs
示例16: InventoryArchiveWriteRequest
/// <summary>
/// Constructor
/// </summary>
public InventoryArchiveWriteRequest(
Guid id, InventoryArchiverModule module, IRegistryCore registry,
UserAccount userInfo, string invPath, Stream saveStream, bool UseAssets, InventoryFolderBase folderBase,
List<AssetBase> assetsToAdd)
{
m_id = id;
m_module = module;
m_registry = registry;
m_userInfo = userInfo;
m_invPath = invPath;
m_saveStream = saveStream;
m_assetGatherer = new UuidGatherer(m_registry.RequestModuleInterface<IAssetService>());
m_saveAssets = UseAssets;
m_defaultFolderToSave = folderBase;
m_assetsToAdd = assetsToAdd;
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:19,代码来源:InventoryArchiveWriteRequest.cs
示例17: SaveInvFolder
/// <summary>
/// Save an inventory folder
/// </summary>
/// <param name = "inventoryFolder">The inventory folder to save</param>
/// <param name = "path">The path to which the folder should be saved</param>
/// <param name = "saveThisFolderItself">If true, save this folder itself. If false, only saves contents</param>
protected void SaveInvFolder(InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself)
{
if (saveThisFolderItself)
{
path += CreateArchiveFolderName(inventoryFolder);
// We need to make sure that we record empty folders
m_archiveWriter.WriteDir(path);
}
InventoryCollection contents
= m_registry.RequestModuleInterface<IInventoryService>().GetFolderContent(inventoryFolder.Owner,
inventoryFolder.ID);
foreach (InventoryFolderBase childFolder in contents.Folders)
{
SaveInvFolder(childFolder, path, true);
}
foreach (InventoryItemBase item in contents.Items)
{
SaveInvItem(item, path);
}
}
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:30,代码来源:InventoryArchiveWriteRequest.cs
示例18: UpdateFolder
/// <summary>
/// Update a folder in the user's inventory
/// </summary>
/// <param name = "folder"></param>
/// <returns>true if the folder was successfully updated</returns>
public bool UpdateFolder(InventoryFolderBase folder)
{
return AddFolder(folder);
}
开发者ID:andsim,项目名称:Aurora-Sim-Optional-Modules,代码行数:9,代码来源:SimianInventoryServiceConnector.cs
示例19: PurgeFolder
public override bool PurgeFolder(InventoryFolderBase folder)
{
// NOGO
return false;
}
开发者ID:KSLcom,项目名称:Aurora-HG-Plugin,代码行数:5,代码来源:HGExternalInventoryService.cs
示例20: UpdateItem
/// <summary>
/// Update an item in the user's inventory
/// </summary>
/// <param name = "item"></param>
/// <returns>true if the item was successfully updated</returns>
public bool UpdateItem(InventoryItemBase item)
{
if (item.AssetID != UUID.Zero)
{
return AddItem(item);
}
else
{
// This is actually a folder update
InventoryFolderBase folder = new InventoryFolderBase(item.ID, item.Name, item.Owner,
(short) item.AssetType, item.Folder, 0);
return UpdateFolder(folder);
}
}
开发者ID:andsim,项目名称:Aurora-Sim-Optional-Modules,代码行数:19,代码来源:SimianInventoryServiceConnector.cs
注:本文中的Aurora.Framework.InventoryFolderBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论