Пример #1
0
        static public void Start()
        {
            if (Instance != null)
            {
                return;
            }

            Instance = new ConsoleMgr();

            try
            {
                Instance.LoadConsoleHandler();
            }
            catch (Exception e)
            {
                Log.Error("ConsoleMgr", "Can not load : " + e.ToString());
            }

            while (Instance._IsRunning)
            {
                string line;

                try
                {
                    line = Console.ReadLine();
                }
                catch
                {
                    // Console fermée
                    break;
                }

                if (line == null)
                {
                    break;
                }


                if (line.StartsWith("."))
                {
                    line = line.Substring(1);

                    if (!Instance.ExecuteCommand(line))
                    {
                        Log.Error("ConsoleMgr", "Command not found");
                    }
                }
                else
                {
                    CleanLine(line.Length);
                }
            }
        }
Пример #2
0
        static public void Start()
        {
            if (Instance != null)
                return;

            Instance = new ConsoleMgr();

            try
            {
                Instance.LoadConsoleHandler();
            }
            catch (Exception e)
            {
                Log.Error("ConsoleMgr", "Can not load : " + e.ToString());
            }

            while (Instance._IsRunning)
            {
                string line;

                try
                {
                    line = Console.ReadLine();
                }
                catch
                {
                    // Console fermée
                    break;
                }

                if ( line == null )
                {
                    break;
                }

                    
                if (line.StartsWith("."))
                {
                    line = line.Substring(1);

                    if (!Instance.ExecuteCommand(line))
                        Log.Error("ConsoleMgr", "Command not found");
                }else CleanLine(line.Length);
            }
        }