Exemplo n.º 1
0
        private bool ProcessTopLevelVoiceCommand(string VoiceCommand)
        {
            bool result = false;

            OpenChecklists();
            if (VoiceCommand.ToLower().Contains("checklist"))
            {
                if (VoiceCommand.ToLower().Contains("open"))
                {
                    result = true;
                    OpenChecklists();
                }
                else if (VoiceCommand.ToLower().Contains("show"))
                {
                    CLListForm        = new ChecklistList();
                    CLListForm.CLForm = CLForm;
                    CLListForm.LoadChecklistFile(ActiveCLFilename);
                }
                else if ((CLForm != null) && ((CLForm.Visible) || (HideGUI)))
                {
                    result = CLForm.ProcessPossibleChecklistCommand(VoiceCommand);
                }
            }
            else if ((CLForm != null) && ((CLForm.Visible) || (HideGUI)))
            {
                result = CLForm.ProcessPossibleChecklistCommand(VoiceCommand);
            }

            return(result);
        }
Exemplo n.º 2
0
        private bool ProcessTopLevelVoiceCommand(string VoiceCommand)
        {
            bool result = false;

            OpenChecklists();

            if (VoiceCommand.ToLower().Contains("checklist"))
            {
                if (VoiceCommand.ToLower().Contains("open"))
                {
                    result = true;
                    OpenChecklists();
                }
                else if (VoiceCommand.ToLower().Contains("show"))
                {
                    CLListForm        = new ChecklistList();
                    CLListForm.CLForm = CLForm;
                    CLListForm.LoadChecklistFile(ActiveCLFilename, "checklist");
                    result = true;
                }
            }
            else if (VoiceCommand.ToLower().Contains("procedure"))
            {
                if (VoiceCommand.ToLower().Contains("show"))
                {
                    CLListForm          = new ChecklistList();
                    CLListForm.ProcForm = ProcForm;
                    CLListForm.LoadChecklistFile(ActiveCLFilename, "procedure");
                    result = true;
                }
                else if (VoiceCommand.ToLower().Contains("abort"))
                {
                    ProcForm.EndProcedure();
                    result = true;
                }
                else
                {
                    string procedure = VoiceCommand.ToLower().Replace("procedure", "").Trim();
                    result = ProcForm.StartProcedure(procedure);
                }
            }

            if (!result && CLForm != null && (CLForm.Visible || HideGUI))
            {
                result = CLForm.ProcessPossibleChecklistCommand(VoiceCommand);
            }

            if (!result)
            {
                // it could be a procedure vcommand that doesn't have the word procedure in it
                foreach (XElement procedure in XElement.Load(ActiveCLFilename).Elements("procedure"))
                {
                    if (!result && procedure.Attribute("vcommand") != null)
                    {
                        string[] voiceCommands = procedure.Attribute("vcommand").Value.ToLower().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (string command in voiceCommands)
                        {
                            if (command == VoiceCommand)
                            {
                                result = ProcForm.StartProcedure(procedure.Attribute("name").Value.ToLower());
                                break;
                            }
                        }
                    }
                }
            }

            return(result);
        }