Exemplo n.º 1
0
 /// <summary>
 /// The interpreter invoked a "close" command.  Close
 /// the scanner
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">event args</param>
 private void Interpreter_EvtCloseNotify(object sender, InterpreterEventArgs e)
 {
     ScannerForm.Invoke(new MethodInvoker(delegate
         {
             Log.Debug("Calling close for " + ScannerForm.Name);
             ScannerForm.Close();
         }));
 }
Exemplo n.º 2
0
 /// <summary>
 /// The stop command was interpreted.
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">event arg</param>
 private void AppInterpreter_EvtStop(object sender, InterpreterEventArgs e)
 {
     Interrupt();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Event handler to transition to the specified animation.
        /// The interpreter triggers this event on the "transition" verb
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">Argument list</param>
        private void AppInterpreter_EvtTransitionNotify(object sender, InterpreterEventArgs e)
        {
            Log.Debug();

            List<String> resolvedArgs = ResolveArgs(e.Args);
            if (resolvedArgs.Count > 0)
            {
                String targetAnimation = resolvedArgs[0];
                Log.Debug(targetAnimation);
                Transition(targetAnimation);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Event handler to select the specified widget.
 /// The interpreter triggers this event on the "select" verb
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">Argument list</param>
 private void AppInterpreter_EvtSelectNotify(object sender, InterpreterEventArgs e)
 {
     List<String> resolvedArgs = ResolveArgs(e.Args);
     if (resolvedArgs.Count > 0)
     {
         var widgetName = e.Args[0];
         SetSelectedWidget(widgetName);
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// Event handler to highlight/unhighlight the specified widget.
        /// This event is triggered by the Interpreter on the "highlightSelected" verb
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">Argument list</param>
        private void AppInterpreter_EvtHighlightSelectedNotify(object sender, InterpreterEventArgs e)
        {
            if (e.Args.Count == 0)
            {
                return;
            }

            bool onOff = false;
            List<String> resolvedArgs = ResolveArgs(e.Args);

            if (e.Args.Count > 1)
            {
                // translate argument from "true" "false" to a boolean
                onOff = ResolveBool(e.Args[1]);
            }

            String widgetName = resolvedArgs[0];

            Log.Debug("_currentPanel " + _currentPanel.Name + " widgetname: " + widgetName);
            var widget = _currentPanel.Finder.FindChild(widgetName);
            if (widget != null)
            {
                if (onOff)
                {
                    widget.SelectedHighlightOn();
                }
                else
                {
                    widget.SelectedHighlightOff();
                }
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Event handler to highlight/unhighlight the specified widget.
        /// This event is triggered by the Interpreter on the "highlight" verb
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">Argument list</param>
        private void AppInterpreter_EvtHighlightNotify(object sender, InterpreterEventArgs e)
        {
            if (e.Args.Count == 0)
            {
                return;
            }

            bool onOff = false;
            List<String> resolvedArgs = ResolveArgs(e.Args);

            if (e.Args.Count > 1)
            {
                // translate argument from "true" "false" to a boolean
                onOff = ResolveBool(e.Args[1]);
            }

            var widgetName = resolvedArgs[0];
            var widget = _currentPanel.Finder.FindChild(widgetName);
            if (widget != null)
            {
                // turn off everything except the one we want
                Widget parent = widget.Parent;
                foreach (Widget child in parent.Children)
                {
                    child.HighlightOff();
                }

                if (onOff)
                {
                    widget.HighlightOn();
                }
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// Event triggered to play a beep sound
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">Argument list</param>
 private void AppInterpreter_EvtBeep(object sender, InterpreterEventArgs e)
 {
     playDefaultBeep();
 }
Exemplo n.º 8
0
        /// <summary>
        /// Event handler to actuate this widget.
        /// The interpreter triggers this event on the "actuate" verb
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">Argument list</param>
        private void AppInterpreter_EvtActuateNotify(object sender, InterpreterEventArgs e)
        {
            List<String> resolvedArgs = ResolveArgs(e.Args);
            if (resolvedArgs.Count > 0)
            {
                String widgetName = resolvedArgs[0];

                // get the widget object
                var widget = _currentPanel.Finder.FindChild(widgetName);
                if (widget != null)
                {
                    Log.Debug("Actuate. widgetname: " + widget.Name + " Text: " + widget.GetText());

                    widget.Actuate();
                }
                else
                {
                    Log.Debug("Did not actuate.  Could not find widget  " + widgetName);
                }
            }
        }