Example #1
0
        /// <summary>
        /// Notifies the subscribers of the hook event that a run command
        /// was encountered.  Give them a chance to act on it first
        /// </summary>
        /// <param name="args">run command args</param>
        /// <param name="handled">did any of them handle it?</param>
        private void notifyRunCommandHookSubscribers(InterpreterRunEventArgs args, ref bool handled)
        {
            if (EvtRunCommandHook == null)
            {
                return;
            }

            var delegates = EvtRunCommandHook.GetInvocationList();

            foreach (var del in delegates)
            {
                var hookDelegate = (RunCommandHook)del;
                hookDelegate.Invoke(args, ref handled);
                if (handled)
                {
                    break;
                }
            }
        }
Example #2
0
        /// <summary>
        /// A 'run' command was interpreted by the interpreter.  Perform
        /// the necessary action.
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void Interpreter_EvtRun(object sender, InterpreterRunEventArgs e)
        {
            if (PreviewMode)
            {
                return;
            }

            Log.Debug(e.Script);

            runCommand(e.Script);
        }
Example #3
0
        /// <summary>
        /// Event handler to run a command. The interpreter raises the event when
        /// it encounters a command in the animation config file
        ///  command
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Interpreter_EvtRun(object sender, InterpreterRunEventArgs e)
        {
            bool handled = false;

            _dialogPanel.OnRunCommand(e.Script, ref handled);
        }
Example #4
0
        /// <summary>
        /// Run a script referred to by scriptRef (e.g., onBack, onSelect etc)
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event arg</param>
        private void AppInterpreter_EvtRun(object sender, InterpreterRunEventArgs e)
        {
            switch (e.Script)
            {
                case "@onBack":
                    if (_player.CurrentAnimation != null && _player.CurrentAnimation.OnBack.HasCode())
                    {
                        _interpreter.Execute(_player.CurrentAnimation.OnBack);
                    }

                    break;
            }
        }