예제 #1
0
        public void Dispose()
        {
            ParentProfile = null;

            TheTrigger.Delete();
            TheAction?.Delete();
        }
예제 #2
0
 public XElement GetXml()
 {
     return(new XElement("TriggeredAction",
                         TheTrigger.GetXml(),
                         TheAction?.GetXml()
                         ));
 }
예제 #3
0
 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();
             }
         }
     }
 }
예제 #4
0
        public override string ToString()
        {
            string output = ((TheAction is CGActionWave) ? "PLAY " : "DO ") + TheAction.ToString();

            output += " WHEN " + TheTrigger.ToString();

            return(output);
        }
예제 #5
0
 public void Dispose()
 {
     if (IsDisposed)
     {
         return;
     }
     StopTicking();
     TheTrigger.Dispose();
 }
예제 #6
0
        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;
                }
            }
        }
예제 #7
0
        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;
                }
            }
        }
예제 #8
0
 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();
 }