public void Dispose() { ParentProfile = null; TheTrigger.Delete(); TheAction?.Delete(); }
public XElement GetXml() { return(new XElement("TriggeredAction", TheTrigger.GetXml(), TheAction?.GetXml() )); }
public void StopTicking() { if (TheTrigger is null) { if (IsTicking) { IsTicking = false; } return; } if (IsTicking) { TheTrigger.Stop(); IsTicking = false; } else { if (!(TheTrigger is null)) { if (TheTrigger.Enabled) { TheTrigger.Stop(); } } } }
public override string ToString() { string output = ((TheAction is CGActionWave) ? "PLAY " : "DO ") + TheAction.ToString(); output += " WHEN " + TheTrigger.ToString(); return(output); }
public void Dispose() { if (IsDisposed) { return; } StopTicking(); TheTrigger.Dispose(); }
public void LoadFromXml(XElement xTriggeredAction) { if (TheAction != null) { throw new Exception("Instance has already been initialilzed."); } if (xTriggeredAction != null) { TheTrigger.LoadFromXml(xTriggeredAction.Element("Trigger")); XElement xWaveFile = xTriggeredAction.Element("CGActionWaveFile"); if (xWaveFile != null) { CGActionWave wav = new CGActionWave(FormMain.WaveOutPool); wav.LoadFromXml(xWaveFile); TheAction = wav; } } }
public void LoadFromXml(XElement xTriggeredAction, bool initializeAction = true) { if (TheAction != null) { throw new Exception("This instance of TriggeredAction has already been loaded."); } if (xTriggeredAction != null) { TheTrigger.LoadFromXml(xTriggeredAction.Element("Trigger")); XElement xWaveFile = xTriggeredAction.Element("CGActionWaveFile"); if (xWaveFile != null) { CGActionWave wav = new CGActionWave(FormMain.WaveOutPool); wav.LoadFromXml(xWaveFile, initializeAction); TheAction = wav; } } }
public void StartTicking(int milliseconds) { if (IsTicking) { return; } IsTicking = true; if (TheTrigger is null) { TheTrigger = new Trigger() { Running_Worker = false, }; } TheTrigger.Interval = TickingInterval = milliseconds; TheTrigger.Name = TriggerName; TheTrigger.Tag = this; TheTrigger.Tick -= TheTriggerWorker; TheTrigger.Tick += TheTriggerWorker; TheTrigger.Start(); }