/
smwwiki
/
OneScript_fork
Обзор
Документация
Войти
/
smwwiki
/
OneScript_fork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/ScriptEngine/Machine/GlobalsHelper.cs
28 строк
859 B
Andrey Ovsiankin
Перенес ITypeManager и сопутствующие зависимости в Core для разрешения имен типов в процессе native компиляции.
05 апр 2021, 14:52
05 апр 2021, 14:52
dea855d
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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 ScriptEngine.Machine.Contexts; using System; namespace ScriptEngine.Machine { public static class GlobalsHelper { public static T GetEnum<T>() { var instance = MachineInstance.Current.Globals; if (instance != null) return instance.GetInstance<T>(); return default; } public static EnumerationContext GetEnum(Type type) { return (EnumerationContext)MachineInstance.Current.Globals?.GetInstance(type); } } }