/
smwwiki
/
OneScript_fork
Обзор
Документация
Войти
/
smwwiki
/
OneScript_fork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/OneScript.StandardLibrary/XMLSchema/Collections/XSSimpleFinalUnion.cs
58 строк
2 KB
Yuri Goncharuk
Исправление замечаний Сонара
23 сен 2023, 13:43
23 сен 2023, 13:43
0d188d8
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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.Xml.Schema; using OneScript.Contexts; using OneScript.StandardLibrary.Collections; using OneScript.StandardLibrary.XMLSchema.Enumerations; using OneScript.Types; using ScriptEngine.Machine.Contexts; namespace OneScript.StandardLibrary.XMLSchema.Collections { [ContextClass("ОбъединениеЗавершенностиПростогоТипаXS", "XSSimpleFinalUnion")] public sealed class XSSimpleFinalUnion : AutoContext<XSSimpleFinalUnion> { private ArrayImpl _values; private bool Contains(XmlSchemaDerivationMethod _value) { var enumValue = EnumerationXSSimpleFinal.FromNativeValue(_value); var idx = _values.Find(enumValue); return idx.SystemType != BasicTypes.Undefined; } public XSSimpleFinalUnion() => _values = ArrayImpl.Constructor(); #region OneScript #region Properties [ContextProperty("Все", "All")] public bool All => Contains(XmlSchemaDerivationMethod.All); [ContextProperty("Объединение", "Union")] public bool Union => Contains(XmlSchemaDerivationMethod.Union); [ContextProperty("Ограничение", "Restriction")] public bool Restriction => Contains(XmlSchemaDerivationMethod.Restriction); [ContextProperty("Список", "List")] public bool List => Contains(XmlSchemaDerivationMethod.List); #endregion #region Methods [ContextMethod("Значения", "Values")] public ArrayImpl Values() => _values; #endregion #endregion } }