muddesigner/MUDEngine/Objects/BaseObject.cs
Scionwest_cp 9a00e47902 MUD Engine:
- Fixed ProjectInformation crashing the engine when it was serialized out by the Project Manager due to Currency serialization issues.
 - Fixed ProjectInformation crashing the engine when it was serializing out the custom BaseObject Controls. [XmlIgnore()] attribute must be attached to each Control Property.
 - Added Zone Builder and Realm Explorer to the Mud Designer Editor list.
 - Currency Editor now loads and displays previously created Currencies within the list.
2009-11-27 21:51:04 -08:00

73 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms;
using System.Xml.Serialization;
using MUDEngine.Controls;
namespace MUDEngine.Objects
{
public class BaseObject
{
public virtual void OnEnter(object sender, EventArgs e)
{
}
[Category("Object Setup")]
[RefreshProperties(RefreshProperties.All)] //Required to refresh Filename property in the editors propertygrid
public string Name
{
get;
set;
}
[Category("Object Setup")]
public string Description
{
get;
set;
}
[Browsable(false)]
public string Script { get; set; }
[ReadOnly(true)]
[Category("Object Setup")]
public string Filename
{
//Returns the name of the object + the objects Type as it's extension.
//Filenames are generated by the class itself, users can not assign it.
get
{
string fileExtension = this.GetType().Name.ToLower();
return this.Name + "." + fileExtension;
}
}
[Browsable(false)]
[XmlIgnore()]
public Controls.VisualContainer Control
{
get
{
return this._Control;
}
internal set
{
this._Control = value;
}
}
private Controls.VisualContainer _Control;
/// <summary>
/// Initializes the base object
/// </summary>
public BaseObject()
{
Control = new Controls.VisualContainer(this);
}
}
}