Example #1
0
        public static void Run(ClientThread clientThread)
        {
            if (clientThread == null)
            {
                throw new ArgumentNullException("clientThread");
            }

            // Loop through the options, and run the ones we allow here
            bool ExitFor = false;

            string[] Processes = LogOnProcess.GetProcesses();
            for (int i = 0; i < Processes.Length; i++)
            {
                try {
                    LogOnProcess LP = new LogOnProcess(Processes[i]);
                    if ((LP.Loaded) && (!clientThread.QuitThread()))
                    {
                        switch (LP.Action)
                        {
                        case Action.Disconnect:
                        case Action.DisplayFile:
                        case Action.DisplayFileMore:
                        case Action.DisplayFilePause:
                        case Action.MainMenu:
                        case Action.Pause:
                        case Action.RunDoor:
                            MenuOption MO = new MenuOption("", '\0')
                            {
                                Action         = LP.Action,
                                Name           = LP.Name,
                                Parameters     = LP.Parameters,
                                RequiredAccess = LP.RequiredAccess,
                            };
                            ExitFor = clientThread.HandleMenuOption(MO);
                            break;
                        }
                        if (ExitFor)
                        {
                            break;
                        }
                    }
                } catch (Exception ex) {
                    // If there's something wrong with the ini entry (Action is invalid for example), this will throw a System.ArgumentException error, so we just ignore that menu item
                    RMLog.Exception(ex, "Error during logon process '" + Processes[i] + "'");
                }
            }
        }