/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/OneScript.StandardLibrary/XMLSchema/Objects/XSDocumentation.cs
103 строки
3 KB
EvilBeaver
Замечание Сонара про необязательный параметр
26 окт 2023, 11:20
26 окт 2023, 11:20
abf8590
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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.Diagnostics.Contracts; using System.Xml.Schema; using OneScript.Contexts; using OneScript.StandardLibrary.XMLSchema.Collections; using OneScript.StandardLibrary.XMLSchema.Enumerations; using OneScript.StandardLibrary.XMLSchema.Interfaces; using ScriptEngine.Machine.Contexts; namespace OneScript.StandardLibrary.XMLSchema.Objects { [ContextClass("ДокументацияXS", "XSDocumentation")] public sealed class XSDocumentation : AutoContext<XSDocumentation>, IXSAnnotationItem { private readonly XmlSchemaDocumentation _documentation; private XSDocumentation() => _documentation = new XmlSchemaDocumentation(); internal XSDocumentation(XmlSchemaDocumentation xmlDocumentation) => _documentation = xmlDocumentation; #region OneScript #region Properties [ContextProperty("Аннотация", "Annotation")] public XSAnnotation Annotation => null; [ContextProperty("Компоненты", "Components")] public XSComponentFixedList Components => XSComponentFixedList.EmptyList(); [ContextProperty("Контейнер", "Container")] public IXSComponent Container { get; private set; } [ContextProperty("КорневойКонтейнер", "RootContainer")] public IXSComponent RootContainer { get; private set; } [ContextProperty("Схема", "Schema")] public XMLSchema Schema => RootContainer.Schema; [ContextProperty("ТипКомпоненты", "ComponentType")] public XSComponentType ComponentType => XSComponentType.Documentation; [ContextProperty("Источник", "Source")] public string Source { get => _documentation.Source; set => _documentation.Source = value; } [ContextProperty("Язык", "Language")] public string Language { get => _documentation.Language; set => _documentation.Language = value; } #endregion #region Methods [ContextMethod("КлонироватьКомпоненту", "CloneComponent")] public IXSComponent CloneComponent(bool recursive = true) => throw new NotImplementedException(); [ContextMethod("ОбновитьЭлементDOM", "UpdateDOMElement")] public void UpdateDOMElement() => throw new NotImplementedException(); [ContextMethod("Содержит", "Contains")] public bool Contains(IXSComponent component) => false; #endregion #region Constructors [ScriptConstructor(Name = "По умолчанию")] public static XSDocumentation Constructor() => new XSDocumentation(); #endregion #endregion #region IXSComponent XmlSchemaObject IXSComponent.SchemaObject => _documentation; void IXSComponent.BindToContainer(IXSComponent rootContainer, IXSComponent container) { Contract.Requires(container is XSAnnotation); RootContainer = rootContainer; Container = container; } #endregion } }