Adds a
VrmlEventDelegate to the event-out slot.
C# |
---|
public abstract void AddVrmlEventDelegate (
VrmlEventDelegate vrmlEventDelegate
) |
The following example shows the skeleton of a
VrmlEventDelegate,
and it demonstrates how to add the delegate to an EventOut object, and how
to remove the delegate when you're finished:
C# |
---|
public class MyClass
{
private static Vrml.EAI.Field.EventOutSFColor diffuseColor_changed;
private static void OnVrmlEvent(Vrml.EAI.Event.VrmlEvent evt)
{
Vrml.EAI.Field.BaseField field = evt.Source;
double time = evt.Time;
object data = evt.Data;
if (field == diffuseColor_changed)
{
// diffuseColor_changed event-out slot fired an event
...
}
...
}
public static void Main(string[] args)
{
...
diffuseColor_changed = ...;
diffuseColor_changed.AddVrmlEventDelegate(OnVrmlEvent);
...
diffuseColor_changed.RemoveVrmlEventDelegate(OnVrmlEvent);
...
}
}
|