Files
QWERTYkez.OpenXmlProcessors/QWERTYkez.WordProcessor/ReplaceItem.cs
2026-06-05 15:58:03 +07:00

24 lines
714 B
C#

namespace QWERTYkez.WordProcessor;
public readonly struct ReplaceItem
{
public ReplaceItem() { }
public ReplaceItem(string text)
{
Text = text;
}
public ReplaceItem(string text, bool breakPage)
{
Text = text;
BreakPage = breakPage;
}
public string Text { get; init; } = string.Empty;
public bool BreakPage { get; init; } = false;
// Неявное преобразование из ReplaceItem в string
//public static implicit operator string(ReplaceItem item) => item.Text;
// Явное преобразование из string в ReplaceItem
public static explicit operator ReplaceItem(string text) => new() { Text = text };
}