36 lines
1015 B
C#
36 lines
1015 B
C#
using Lattice.Core.Abstractions;
|
|
|
|
namespace Lattice.Core.Models;
|
|
|
|
/// <summary>
|
|
/// Абстрактный базовый класс для всех узлов дерева компоновки.
|
|
/// </summary>
|
|
public abstract class LayoutNode : ILayoutElement
|
|
{
|
|
/// <inheritdoc/>
|
|
public Guid Id { get; } = Guid.NewGuid();
|
|
|
|
/// <inheritdoc/>
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
/// <inheritdoc/>
|
|
public double WidthValue { get; set; } = 1.0;
|
|
|
|
/// <inheritdoc/>
|
|
public bool IsWidthStar { get; set; } = true;
|
|
|
|
/// <inheritdoc/>
|
|
public double HeightValue { get; set; } = 1.0;
|
|
|
|
/// <inheritdoc/>
|
|
public bool IsHeightStar { get; set; } = true;
|
|
|
|
/// <inheritdoc/>
|
|
public ILayoutElement? Parent { get; set; }
|
|
|
|
/// <summary>
|
|
/// Возвращает строковое представление узла для отладки.
|
|
/// </summary>
|
|
public override string ToString() => $"{GetType().Name} [{Name}] ({Id.ToString()[..4]})";
|
|
}
|