/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v2.0.3-alpha
src/Component/SimpleClass.cs
40 строк
1 KB
Andrey Ovsiankin
Рефакторинг неймспейсов
30 авг 2021, 16:41
30 авг 2021, 16:41
225528b
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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 OneScript.Contexts; using ScriptEngine.Machine; using ScriptEngine.Machine.Contexts; namespace Component { [ContextClass("ПростоКласс")] public sealed class SimpleClass : AutoContext<SimpleClass>, ISimple { [ContextProperty("СвойствоПеречисление")] public SimpleEnum EnumProperty { get; set; } [ContextProperty("ЦелочисленноеСвойство")] public int IntProperty { get; set; } [ContextProperty("СвойствоСПроизвольнымЗначением")] public IValue AnyValueProperty { get; set; } [ScriptConstructor] public static SimpleClass Constructor() { return new SimpleClass(); } [ScriptConstructor] public static SimpleClass Constructor(IValue initialProperty) { var result = new SimpleClass(); result.IntProperty = ContextValuesMarshaller.ConvertParam<int>(initialProperty); return result; } } }