/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v1.6.0
src/ASPNETHandler/ASPNetApplicationHost.cs
75 строк
2 KB
Michael Rybakin
fix #1065: сигнатура ВвестиСтроку() приведена к базовой платформе
30 мар 2021, 11:33
30 мар 2021, 11:33
68aa911
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ScriptEngine.HostedScript; using ScriptEngine.HostedScript.Library; namespace OneScript.ASPNETHandler { class ASPNetApplicationHost : IHostApplication { public void Echo(string str, MessageStatusEnum status = MessageStatusEnum.Ordinary) { if (status == MessageStatusEnum.Ordinary) { Console.WriteLine(str); } else { var oldColor = Console.ForegroundColor; ConsoleColor newColor; switch (status) { case MessageStatusEnum.Information: newColor = ConsoleColor.Green; break; case MessageStatusEnum.Attention: newColor = ConsoleColor.Yellow; break; case MessageStatusEnum.Important: case MessageStatusEnum.VeryImportant: newColor = ConsoleColor.Red; break; default: newColor = oldColor; break; } try { Console.ForegroundColor = newColor; Console.WriteLine(str); } finally { Console.ForegroundColor = oldColor; } } } public void ShowExceptionInfo(Exception exc) { throw new NotImplementedException(); } public bool InputString(out string result, string prompt, int maxLen, bool multiline) { throw new NotImplementedException(); } public string[] GetCommandLineArguments() { throw new NotImplementedException(); } } }