Game Development Reference
In-Depth Information
namespace SampleApp.ObjectModel
{
public class EnhancedBindingList<T> : BindingList<T>
{
Note
The full source code for this class is available on the Companion Web site.
}
}
Our object model is now built (I did not lie when I said it was too simple to be
real-world applicable!) so we can start linking events. The first events we will link
are related to the script engine. Specifically, we want to handle the event for errors
that occur, the event for displaying script output, and the event for code execution
that uses our scripting engine. Additionally, we will tie into the event the handles
application exceptions.
The following code shows how these events are linked and implemented in the
example on the Companion Web site.
namespace SampleApp
{
using ObjectModel;
using Scripting;
using Entities;
public partial class MainForm : Form
{
Note
The full source code for this class is available on the Companion Web site.
}
}
We now want to link up some views to display the information contained in the
object model. The first view we will implement is a TreeView that just lists
SimpleEntity nodes under a parent node. The following code shows the event han-
dling for this type of view.
namespace SampleApp
{
 
Search Nedrilad ::




Custom Search