// ----------------------------------------------------
 // name: StartListeningForChuckEvent
 // desc: call the callback every time that
 //       external Event variableName signals it
 //       (until canceled)
 // ----------------------------------------------------
 public bool StartListeningForChuckEvent(string variableName, Chuck.VoidCallback callback)
 {
     return(chuckMainInstance.StartListeningForChuckEvent(variableName, callback));
 }
示例#2
0
 public bool StopListeningForChuckEvent(System.UInt32 chuckId, string variableName, Chuck.VoidCallback callback)
 {
     // Don't need to save the callback - it will not be called; only the value of its pointer will be checked
     return(stopListeningForChuckEvent(chuckId, variableName, callback));
 }
 // ----------------------------------------------------
 // name: ListenForChuckEventOnce
 // desc: call the callback only the next time that
 //       external Event variableName signals it
 // ----------------------------------------------------
 public bool ListenForChuckEventOnce(string variableName, Chuck.VoidCallback callback)
 {
     return(chuckMainInstance.ListenForChuckEventOnce(variableName, callback));
 }
示例#4
0
    public bool StartListeningForChuckEvent(System.UInt32 chuckId, string variableName, Chuck.VoidCallback callback)
    {
        // save a copy of the delegate so it doesn't get garbage collected!
        string internalKey = chuckId.ToString() + "$" + variableName;

        voidCallbacks[internalKey] = callback;
        return(startListeningForChuckEvent(chuckId, variableName, callback));
    }