2026-06-05 15:58:03 +07:00
|
|
|
namespace QWERTYkez.WordProcessor;
|
|
|
|
|
|
2026-08-10 13:58:11 +07:00
|
|
|
/// <summary> Определяет тип разрыва или смены ориентации страницы </summary>
|
|
|
|
|
public enum BreakType
|
2026-07-21 16:43:59 +07:00
|
|
|
{
|
|
|
|
|
/// <summary>Обычный разрыв страницы (новый лист).</summary>
|
|
|
|
|
PageBreak,
|
|
|
|
|
/// <summary>Начать новую секцию с альбомной ориентацией страницы.</summary>
|
|
|
|
|
NewLandscapeSection,
|
|
|
|
|
/// <summary>Начать новую секцию с книжной ориентацией страницы.</summary>
|
|
|
|
|
NewPortraitSection,
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-10 13:58:11 +07:00
|
|
|
public class ReplaceItem
|
2026-06-05 15:58:03 +07:00
|
|
|
{
|
2026-08-10 13:58:11 +07:00
|
|
|
private ReplaceItem() { }
|
|
|
|
|
public ReplaceItem(string text) => _Text = text;
|
|
|
|
|
public ReplaceItem(BreakType item) => _BreakValue = item;
|
|
|
|
|
|
2026-07-21 16:43:59 +07:00
|
|
|
|
2026-08-10 13:58:11 +07:00
|
|
|
public static implicit operator ReplaceItem(string text) => new(text);
|
|
|
|
|
public static implicit operator ReplaceItem(BreakType item) => item switch
|
|
|
|
|
{
|
|
|
|
|
BreakType.PageBreak => PageBreak,
|
|
|
|
|
BreakType.NewLandscapeSection => NewLandscapeSection,
|
|
|
|
|
BreakType.NewPortraitSection => NewPortraitSection,
|
|
|
|
|
_ => throw new NotImplementedException()
|
|
|
|
|
};
|
2026-06-05 15:58:03 +07:00
|
|
|
|
2026-08-10 13:58:11 +07:00
|
|
|
public static ReplaceItem PageBreak { get; } = new() { _BreakValue = BreakType.PageBreak };
|
|
|
|
|
public static ReplaceItem NewLandscapeSection { get; } = new() { _BreakValue = BreakType.NewLandscapeSection };
|
|
|
|
|
public static ReplaceItem NewPortraitSection { get; } = new() { _BreakValue = BreakType.NewPortraitSection };
|
2026-06-05 15:58:03 +07:00
|
|
|
|
2026-08-10 13:58:11 +07:00
|
|
|
public string Text => _Text;
|
|
|
|
|
public string _Text = string.Empty;
|
2026-06-05 15:58:03 +07:00
|
|
|
|
2026-08-10 13:58:11 +07:00
|
|
|
public BreakType? BreakValue => _BreakValue;
|
|
|
|
|
public BreakType? _BreakValue;
|
2026-06-05 15:58:03 +07:00
|
|
|
}
|