/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/OneScript.StandardLibrary/TypeDescriptions/BinaryDataQualifiers.cs
56 строк
2 KB
EvilBeaver
Удален устаревший метод OnAttach и массово исправлены неиспользуемые using
02 дек 2025, 11:20
02 дек 2025, 11:20
0301fed
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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 OneScript.Contexts; using OneScript.Values; using ScriptEngine.Machine.Contexts; namespace OneScript.StandardLibrary.TypeDescriptions { [ContextClass("КвалификаторыДвоичныхДанных", "BinaryDataQualifiers")] public sealed class BinaryDataQualifiers : AutoContext<BinaryDataQualifiers> { public BinaryDataQualifiers(int length = 0, AllowedLengthEnum allowedLength = AllowedLengthEnum.Variable) { Length = length; AllowedLength = allowedLength; } [ContextProperty("Длина", "Length")] public int Length { get; } [ContextProperty("ДопустимаяДлина", "AllowedLength")] public AllowedLengthEnum AllowedLength { get; } public override bool Equals(object obj) { if (!(obj is BinaryDataQualifiers asThis)) return false; return Length == asThis.Length && AllowedLength == asThis.AllowedLength; } public override bool Equals(BslValue other) { return Equals((object)other); } public override int GetHashCode() { return HashCode.Combine(Length, AllowedLength); } [ScriptConstructor] public static BinaryDataQualifiers Constructor(int length = default, AllowedLengthEnum allowedLength = default) { return new BinaryDataQualifiers(length, allowedLength); } } }