本文整理汇总了C#中OpenMetaverse.InventoryItem类的典型用法代码示例。如果您正苦于以下问题:C# InventoryItem类的具体用法?C# InventoryItem怎么用?C# InventoryItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InventoryItem类属于OpenMetaverse命名空间,在下文中一共展示了InventoryItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: frmGive
public frmGive(METAboltInstance instance, InventoryItem item)
{
InitializeComponent();
this.instance = instance;
//netcom = this.instance.Netcom;
client = this.instance.Client;
this.item = item;
textBox1.GotFocus += textBox1_GotFocus;
textBox1.MouseUp += textBox1_MouseUp;
textBox1.Leave += textBox1_Leave;
client.Directory.DirPeopleReply += new EventHandler<DirPeopleReplyEventArgs>(Directory_OnDirPeopleReply);
client.Groups.GroupMembersReply += new EventHandler<GroupMembersReplyEventArgs>(GroupMembersHandler);
client.Avatars.UUIDNameReply += new EventHandler<UUIDNameReplyEventArgs>(AvatarNamesHandler);
groupmode = false;
client.Groups.RequestCurrentGroups();
label2.Text = "Give item: " + item.Name;
lvwColumnSorter = new NumericStringComparer();
lvwFindFriends.ListViewItemSorter = lvwColumnSorter;
lvwSelected.ListViewItemSorter = lvwColumnSorter;
}
示例2: InventoryGestureConsol
public InventoryGestureConsol(METAboltInstance instance, InventoryItem item)
{
InitializeComponent();
this.instance = instance;
client = this.instance.Client;
this.item = item;
}
示例3: InventoryObjectConsole
public InventoryObjectConsole(METAboltInstance instance, InventoryItem item)
{
InitializeComponent();
this.instance = instance;
//netcom = this.instance.Netcom;
client = this.instance.Client;
this.item = item;
}
示例4: InventoryAnimationConsole
public InventoryAnimationConsole(METAboltInstance instance, InventoryItem item)
{
InitializeComponent();
this.instance = instance;
//netcom = this.instance.Netcom;
client = this.instance.Client;
this.item = item;
this.Disposed += new EventHandler(InventoryAnimation_Disposed);
}
示例5: InventoryItemConsole
//private InventoryConsole iconsole;
//private TreeNode inode;
public InventoryItemConsole(METAboltInstance instance, InventoryItem item)
{
InitializeComponent();
this.instance = instance;
//netcom = this.instance.Netcom;
client = this.instance.Client;
this.item = item;
this.Disposed += new EventHandler(InventoryItemConsole_Disposed);
//iconsole = new InventoryConsole(instance);
AddClientEvents();
FillItemProperties();
}
示例6: InventoryImageConsole
public InventoryImageConsole(METAboltInstance instance, InventoryItem item)
{
InitializeComponent();
this.instance = instance;
//netcom = this.instance.Netcom;
client = this.instance.Client;
this.item = item;
if (instance.ImageCache.ContainsImage(item.AssetUUID))
SetFinalImage(instance.ImageCache.GetImage(item.AssetUUID));
else
{
this.Disposed += new EventHandler(InventoryImageConsole_Disposed);
//client.Assets.OnImageRecieveProgress += new AssetManager.ImageReceiveProgressCallback(Assets_OnImageReceived);
}
}
示例7: frmNotecardEditor
public frmNotecardEditor(METAboltInstance instance, InventoryItem item)
{
InitializeComponent();
this.instance = instance;
netcom = this.instance.Netcom;
client = this.instance.Client;
this.item = item;
Disposed += new EventHandler(Notecard_Disposed);
AddNetcomEvents();
objectid = UUID.Zero;
istaskobj = false;
this.Text = item.Name + " (notecard) - METAbolt";
assetUUID = item.AssetUUID;
rtbNotecard.TextChanged += new EventHandler(rtbNotecard_TextChanged);
client.Assets.RequestInventoryAsset(assetUUID, item.UUID, UUID.Zero, item.OwnerID, item.AssetType, true, Assets_OnAssetReceived);
}
示例8: ItemReceivedEventArgs
public ItemReceivedEventArgs(InventoryItem item)
{
this.m_Item = item;
}
示例9: ParseTaskInventory
/// <summary>
/// Parse the results of a RequestTaskInventory() response
/// </summary>
/// <param name="taskData">A string which contains the data from the task reply</param>
/// <returns>A List containing the items contained within the tasks inventory</returns>
public static List<InventoryBase> ParseTaskInventory(string taskData)
{
List<InventoryBase> items = new List<InventoryBase>();
int lineNum = 0;
string[] lines = taskData.Replace("\r\n", "\n").Split('\n');
while (lineNum < lines.Length)
{
string key, value;
if (ParseLine(lines[lineNum++], out key, out value))
{
if (key == "inv_object")
{
#region inv_object
// In practice this appears to only be used for folders
UUID itemID = UUID.Zero;
UUID parentID = UUID.Zero;
string name = String.Empty;
AssetType assetType = AssetType.Unknown;
while (lineNum < lines.Length)
{
if (ParseLine(lines[lineNum++], out key, out value))
{
if (key == "{")
{
continue;
}
else if (key == "}")
{
break;
}
else if (key == "obj_id")
{
UUID.TryParse(value, out itemID);
}
else if (key == "parent_id")
{
UUID.TryParse(value, out parentID);
}
else if (key == "type")
{
assetType = Utils.StringToAssetType(value);
}
else if (key == "name")
{
name = value.Substring(0, value.IndexOf('|'));
}
}
}
if (assetType == AssetType.Folder)
{
InventoryFolder folder = new InventoryFolder(itemID);
folder.Name = name;
folder.ParentUUID = parentID;
items.Add(folder);
}
else
{
InventoryItem item = new InventoryItem(itemID);
item.Name = name;
item.ParentUUID = parentID;
item.AssetType = assetType;
items.Add(item);
}
#endregion inv_object
}
else if (key == "inv_item")
{
#region inv_item
// Any inventory item that links to an assetID, has permissions, etc
UUID itemID = UUID.Zero;
UUID assetID = UUID.Zero;
UUID parentID = UUID.Zero;
UUID creatorID = UUID.Zero;
UUID ownerID = UUID.Zero;
UUID lastOwnerID = UUID.Zero;
UUID groupID = UUID.Zero;
bool groupOwned = false;
string name = String.Empty;
string desc = String.Empty;
AssetType assetType = AssetType.Unknown;
InventoryType inventoryType = InventoryType.Unknown;
DateTime creationDate = Utils.Epoch;
uint flags = 0;
Permissions perms = Permissions.NoPermissions;
SaleType saleType = SaleType.Not;
int salePrice = 0;
//.........这里部分代码省略.........
示例10: CopyScriptToTask
/// <summary>
/// Copy an InventoryScript item from the Agents Inventory into a primitives task inventory
/// </summary>
/// <param name="objectLocalID">An unsigned integer representing a primitive being simulated</param>
/// <param name="item">An <seealso cref="InventoryItem"/> which represents a script object from the agents inventory</param>
/// <param name="enableScript">true to set the scripts running state to enabled</param>
/// <returns>A Unique Transaction ID</returns>
/// <example>
/// The following example shows the basic steps necessary to copy a script from the agents inventory into a tasks inventory
/// and assumes the script exists in the agents inventory.
/// <code>
/// uint primID = 95899503; // Fake prim ID
/// UUID scriptID = UUID.Parse("92a7fe8a-e949-dd39-a8d8-1681d8673232"); // Fake Script UUID in Inventory
///
/// Client.Inventory.FolderContents(Client.Inventory.FindFolderForType(AssetType.LSLText), Client.Self.AgentID,
/// false, true, InventorySortOrder.ByName, 10000);
///
/// Client.Inventory.RezScript(primID, (InventoryItem)Client.Inventory.Store[scriptID]);
/// </code>
/// </example>
// DocTODO: what does the return UUID correlate to if anything?
public UUID CopyScriptToTask(uint objectLocalID, InventoryItem item, bool enableScript)
{
UUID transactionID = UUID.Random();
RezScriptPacket ScriptPacket = new RezScriptPacket();
ScriptPacket.AgentData.AgentID = Client.Self.AgentID;
ScriptPacket.AgentData.SessionID = Client.Self.SessionID;
ScriptPacket.UpdateBlock.ObjectLocalID = objectLocalID;
ScriptPacket.UpdateBlock.Enabled = enableScript;
ScriptPacket.InventoryBlock.ItemID = item.UUID;
ScriptPacket.InventoryBlock.FolderID = item.ParentUUID;
ScriptPacket.InventoryBlock.CreatorID = item.CreatorID;
ScriptPacket.InventoryBlock.OwnerID = item.OwnerID;
ScriptPacket.InventoryBlock.GroupID = item.GroupID;
ScriptPacket.InventoryBlock.BaseMask = (uint)item.Permissions.BaseMask;
ScriptPacket.InventoryBlock.OwnerMask = (uint)item.Permissions.OwnerMask;
ScriptPacket.InventoryBlock.GroupMask = (uint)item.Permissions.GroupMask;
ScriptPacket.InventoryBlock.EveryoneMask = (uint)item.Permissions.EveryoneMask;
ScriptPacket.InventoryBlock.NextOwnerMask = (uint)item.Permissions.NextOwnerMask;
ScriptPacket.InventoryBlock.GroupOwned = item.GroupOwned;
ScriptPacket.InventoryBlock.TransactionID = transactionID;
ScriptPacket.InventoryBlock.Type = (sbyte)item.AssetType;
ScriptPacket.InventoryBlock.InvType = (sbyte)item.InventoryType;
ScriptPacket.InventoryBlock.Flags = (uint)item.Flags;
ScriptPacket.InventoryBlock.SaleType = (byte)item.SaleType;
ScriptPacket.InventoryBlock.SalePrice = item.SalePrice;
ScriptPacket.InventoryBlock.Name = Utils.StringToBytes(item.Name);
ScriptPacket.InventoryBlock.Description = Utils.StringToBytes(item.Description);
ScriptPacket.InventoryBlock.CreationDate = (int)Utils.DateTimeToUnixTime(item.CreationDate);
ScriptPacket.InventoryBlock.CRC = ItemCRC(item);
Client.Network.SendPacket(ScriptPacket);
return transactionID;
}
示例11: RequestRestoreRezFromInventory
/// <summary>
/// Rez an item from inventory to its previous simulator location
/// </summary>
/// <param name="simulator"></param>
/// <param name="item"></param>
/// <param name="queryID"></param>
/// <returns></returns>
public UUID RequestRestoreRezFromInventory(Simulator simulator, InventoryItem item, UUID queryID)
{
RezRestoreToWorldPacket add = new RezRestoreToWorldPacket();
add.AgentData.AgentID = Client.Self.AgentID;
add.AgentData.SessionID = Client.Self.SessionID;
add.InventoryData.ItemID = item.UUID;
add.InventoryData.FolderID = item.ParentUUID;
add.InventoryData.CreatorID = item.CreatorID;
add.InventoryData.OwnerID = item.OwnerID;
add.InventoryData.GroupID = item.GroupID;
add.InventoryData.BaseMask = (uint)item.Permissions.BaseMask;
add.InventoryData.OwnerMask = (uint)item.Permissions.OwnerMask;
add.InventoryData.GroupMask = (uint)item.Permissions.GroupMask;
add.InventoryData.EveryoneMask = (uint)item.Permissions.EveryoneMask;
add.InventoryData.NextOwnerMask = (uint)item.Permissions.NextOwnerMask;
add.InventoryData.GroupOwned = item.GroupOwned;
add.InventoryData.TransactionID = queryID;
add.InventoryData.Type = (sbyte)item.InventoryType;
add.InventoryData.InvType = (sbyte)item.InventoryType;
add.InventoryData.Flags = (uint)item.Flags;
add.InventoryData.SaleType = (byte)item.SaleType;
add.InventoryData.SalePrice = item.SalePrice;
add.InventoryData.Name = Utils.StringToBytes(item.Name);
add.InventoryData.Description = Utils.StringToBytes(item.Description);
add.InventoryData.CreationDate = (int)Utils.DateTimeToUnixTime(item.CreationDate);
Client.Network.SendPacket(add, simulator);
return queryID;
}
示例12: RequestRezFromInventory
/// <summary>
/// Rez an object from inventory
/// </summary>
/// <param name="simulator">Simulator to place object in</param>
/// <param name="rotation">Rotation of the object when rezzed</param>
/// <param name="position">Vector of where to place object</param>
/// <param name="item">InventoryItem object containing item details</param>
/// <param name="groupOwner">UUID of group to own the object</param>
public UUID RequestRezFromInventory(Simulator simulator, Quaternion rotation, Vector3 position,
InventoryItem item, UUID groupOwner)
{
return RequestRezFromInventory(simulator, rotation, position, item, groupOwner, UUID.Random(), true);
}
示例13: RequestUpdateItem
/// <summary>
///
/// </summary>
/// <param name="item"></param>
public void RequestUpdateItem(InventoryItem item)
{
List<InventoryItem> items = new List<InventoryItem>(1);
items.Add(item);
RequestUpdateItems(items, UUID.Random());
}
示例14: IsItemWorn
/// <summary>
/// Checks if an inventory item is currently being worn
/// </summary>
/// <param name="item">The inventory item to check against the agent
/// wearables</param>
/// <returns>The WearableType slot that the item is being worn in,
/// or WearbleType.Invalid if it is not currently being worn</returns>
public WearableType IsItemWorn(InventoryItem item)
{
lock (Wearables)
{
foreach (KeyValuePair<WearableType, WearableData> entry in Wearables)
{
if (entry.Value.ItemID == item.UUID)
return entry.Key;
}
}
return WearableType.Invalid;
}
示例15: Detach
/// <summary>
/// Detach an item from our agent using an <seealso cref="OpenMetaverse.InventoryItem"/> object
/// </summary>
/// <param name="item">An <seealso cref="OpenMetaverse.InventoryItem"/> object</param>
public void Detach(InventoryItem item)
{
Detach(item.UUID);
}