Добавьте файлы проекта.
This commit is contained in:
16
Lattice.Core/Models/ActionDefinition.cs
Normal file
16
Lattice.Core/Models/ActionDefinition.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Lattice.Core.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Определение команды для панели инструментов или меню.
|
||||
/// </summary>
|
||||
public class ActionDefinition
|
||||
{
|
||||
public string Id { get; init; } = string.Empty;
|
||||
public string Label { get; init; } = string.Empty;
|
||||
public string IconKey { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Контекст, в котором эта кнопка должна быть доступна (например, "C#", "XAML", "Common").
|
||||
/// </summary>
|
||||
public string TargetContext { get; init; } = "Common";
|
||||
}
|
||||
29
Lattice.Core/Models/ContentNode.cs
Normal file
29
Lattice.Core/Models/ContentNode.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Lattice.Core.Abstractions;
|
||||
|
||||
namespace Lattice.Core.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Узел, представляющий конечный контент (вкладку, панель инструментов или документ).
|
||||
/// </summary>
|
||||
public class ContentNode : LayoutNode
|
||||
{
|
||||
/// <summary>
|
||||
/// Ссылка на визуальный или логический компонент, закрепленный в этом узле.
|
||||
/// </summary>
|
||||
public IDockableComponent? Component { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Указывает, является ли данный узел частью основной рабочей области документов.
|
||||
/// </summary>
|
||||
public bool IsDocumentArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Инициализирует новый экземпляр <see cref="ContentNode"/> на основе компонента.
|
||||
/// </summary>
|
||||
/// <param name="component">Компонент содержимого.</param>
|
||||
public ContentNode(IDockableComponent component)
|
||||
{
|
||||
Component = component;
|
||||
Name = component.DisplayName;
|
||||
}
|
||||
}
|
||||
11
Lattice.Core/Models/Enums/DockDirection.cs
Normal file
11
Lattice.Core/Models/Enums/DockDirection.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Lattice.Core.Models.Enums;
|
||||
|
||||
public enum DockDirection
|
||||
{
|
||||
Center,
|
||||
Left,
|
||||
Right,
|
||||
Top,
|
||||
Bottom,
|
||||
Floating,
|
||||
}
|
||||
13
Lattice.Core/Models/Enums/SplitOrientation.cs
Normal file
13
Lattice.Core/Models/Enums/SplitOrientation.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Lattice.Core.Models.Enums;
|
||||
|
||||
public enum SplitOrientation
|
||||
{
|
||||
/// <summary>
|
||||
/// Элементы располагаются друг за другом по горизонтали
|
||||
/// </summary>
|
||||
Horizontal,
|
||||
/// <summary>
|
||||
/// Элементы располагаются друг за другом по вертикали
|
||||
/// </summary>
|
||||
Vertical,
|
||||
}
|
||||
35
Lattice.Core/Models/LayoutNode.cs
Normal file
35
Lattice.Core/Models/LayoutNode.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
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]})";
|
||||
}
|
||||
38
Lattice.Core/Models/SplitContainerNode.cs
Normal file
38
Lattice.Core/Models/SplitContainerNode.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Lattice.Core.Models.Enums;
|
||||
|
||||
namespace Lattice.Core.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Узел-контейнер, разделяющий пространство между дочерними элементами в определенной ориентации.
|
||||
/// </summary>
|
||||
public class SplitContainerNode : LayoutNode
|
||||
{
|
||||
/// <summary>
|
||||
/// Ориентация разделения (горизонтальная или вертикальная).
|
||||
/// </summary>
|
||||
public SplitOrientation Orientation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Список дочерних узлов, находящихся внутри данного контейнера.
|
||||
/// </summary>
|
||||
public List<LayoutNode> Children { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Инициализирует новый экземпляр <see cref="SplitContainerNode"/>.
|
||||
/// </summary>
|
||||
/// <param name="orientation">Ориентация контейнера.</param>
|
||||
public SplitContainerNode(SplitOrientation orientation)
|
||||
{
|
||||
Orientation = orientation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Добавляет дочерний узел в контейнер и устанавливает связь с родителем.
|
||||
/// </summary>
|
||||
/// <param name="child">Узел для добавления.</param>
|
||||
public void AddChild(LayoutNode child)
|
||||
{
|
||||
child.Parent = this;
|
||||
Children.Add(child);
|
||||
}
|
||||
}
|
||||
12
Lattice.Core/Models/WorkspaceSnapshot.cs
Normal file
12
Lattice.Core/Models/WorkspaceSnapshot.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Lattice.Core.Models
|
||||
{
|
||||
internal class WorkspaceSnapshot
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user