コード例 #1
0
ファイル: ScreenViewModel.cs プロジェクト: taradinoc/ZDebug
        void IInputStream.ReadCommand(int maxChars, Action <string> callback)
        {
            Dispatch(() =>
            {
                if (gameScriptService.HasNextCommand())
                {
                    ResetStatusHeight();
                    currStatusHeight = 0;

                    string command = gameScriptService.GetNextCommand();
                    windowManager.ActiveWindow.PutString(command + "\r\n");
                    callback(command);
                }
                else
                {
                    mainWindow.ReadCommand(maxChars, text =>
                    {
                        ResetStatusHeight();
                        currStatusHeight = 0;

                        callback(text);
                    });
                }
            });
        }
コード例 #2
0
ファイル: OutputViewModel.cs プロジェクト: taradinoc/ZDebug
        public void ReadCommand(int maxChars, Action <string> callback)
        {
            if (gameScriptService.HasNextCommand())
            {
                ResetStatusHeight();
                currStatusHeight = 0;

                string command = gameScriptService.GetNextCommand();
                windowManager.ActiveWindow.PutString(command + "\r\n");
                callback(command);
            }
            else
            {
                debuggerService.BeginAwaitingInput();

                mainWindow.ReadCommand(maxChars, text =>
                {
                    ResetStatusHeight();
                    currStatusHeight = 0;

                    callback(text);
                    debuggerService.EndAwaitingInput();
                });
            }
        }