muddesigner/MUDEngine/Objects/BaseObject.cs
Scionwest_cp 72a111c09d Mud Engine:
- Added Controls namespace to the engine
 - Copied VisualContainer and RoomControl from Visual Designer to MUDEngine.Controls namespace
 - Added Control property to BaseObject, all objects now can have a custom UserControl that the Visual Designer will create during runtime when the object is dragged to the designer.
2009-11-27 20:44:15 -08:00

70 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms;
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)]
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);
}
}
}