/
smwwiki
/
OneScript_fork
Обзор
Документация
Войти
/
smwwiki
/
OneScript_fork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/OneScript.StandardLibrary/XMLSchema/Collections/XSDisallowedSubstitutionsUnion.cs
55 строк
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", "XSDisallowedSubstitutionsUnion")] public sealed class XsDisallowedSubstitutionsUnion : AutoContext<XsDisallowedSubstitutionsUnion> { private readonly ArrayImpl _values; private bool Contains(XmlSchemaDerivationMethod value) { var enumValue = EnumerationXSDisallowedSubstitutions.FromNativeValue(value); var idx = _values.Find(enumValue); return (idx.SystemType != BasicTypes.Undefined); } internal XsDisallowedSubstitutionsUnion() => _values = ArrayImpl.Constructor(); #region OneScript #region Properties [ContextProperty("Все", "All")] public bool All => Contains(XmlSchemaDerivationMethod.All); [ContextProperty("Ограничение", "Restriction")] public bool Restriction => Contains(XmlSchemaDerivationMethod.Restriction); [ContextProperty("Расширение", "Extension")] public bool Extension => Contains(XmlSchemaDerivationMethod.Extension); #endregion #region Methods [ContextMethod("Значения", "Values")] public ArrayImpl Values() => _values; #endregion #endregion } }