* libsecondlife-cs is now libsecondlife * All applications that are staying have been moved to trunk/ * SLProxy loads Analyst plugin by default if no other plugin is specified on the command line git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1068 52acb1d6-8a22-11de-b505-999d5b087335
63 lines
1.4 KiB
C#
63 lines
1.4 KiB
C#
using System;
|
|
|
|
using libsecondlife;
|
|
using libsecondlife.AssetSystem;
|
|
|
|
namespace libsecondlife.InventorySystem
|
|
{
|
|
/// <summary>
|
|
/// Base class for Inventory items
|
|
/// </summary>
|
|
abstract public class InventoryBase
|
|
{
|
|
protected InventoryManager iManager;
|
|
|
|
internal string _Name;
|
|
|
|
/// <summary>
|
|
/// </summary>
|
|
/// <param name="manager"></param>
|
|
internal InventoryBase(InventoryManager manager)
|
|
{
|
|
if( manager == null )
|
|
{
|
|
throw new Exception( "Inventory Manager cannot be null" );
|
|
}
|
|
iManager = manager;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Output this item as XML
|
|
/// </summary>
|
|
/// <param name="outputAssets">Include an asset data as well, TRUE/FALSE</param>
|
|
abstract public string toXML(bool outputAssets);
|
|
|
|
/// <summary>
|
|
/// Get a short string describing this item's type
|
|
/// </summary>
|
|
abstract public string GetDisplayType();
|
|
|
|
/// <summary>
|
|
/// Utility function to simply making text XML safe
|
|
/// </summary>
|
|
/// <param name="str"></param>
|
|
protected string xmlSafe(string str)
|
|
{
|
|
if( str != null )
|
|
{
|
|
string clean = str.Replace("&","&");
|
|
clean = clean.Replace("<","<");
|
|
clean = clean.Replace(">",">");
|
|
clean = clean.Replace("'","'");
|
|
clean = clean.Replace("\"",""");
|
|
return clean;
|
|
}
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|