/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/OneScript.Core/Contexts/BslAnnotationAttribute.cs
57 строк
2 KB
Sergey Batanov
Изменено представление аннотаций в образе.
01 сен 2025, 17:05
01 сен 2025, 17:05
67edf3a
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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.Commons; using OneScript.Values; using System; using System.Collections.Generic; namespace OneScript.Contexts { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Parameter)] public class BslAnnotationAttribute : Attribute { public BslAnnotationAttribute(string name) { Name = name; } public BslAnnotationAttribute(string name, IEnumerable<BslAnnotationParameter> parameters) { Name = name; Parameters = parameters; } public string Name { get; } public IEnumerable<BslAnnotationParameter> Parameters { get; private set; } public void SetParameters(IEnumerable<BslAnnotationParameter> parameters) { Parameters = new List<BslAnnotationParameter>(parameters); } } public class BslAnnotationParameter { public BslAnnotationParameter(string name, BslPrimitiveValue value = null) { Name = name; Value = value; } public string Name { get; } public BslPrimitiveValue Value { get; } public override string ToString() { return Utils.NameAndValuePresentation(Name, Value); } } }