Добавьте файлы проекта.
This commit is contained in:
24
QWERTYkez.WordProcessor/ReplaceItem.cs
Normal file
24
QWERTYkez.WordProcessor/ReplaceItem.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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 };
|
||||
}
|
||||
Reference in New Issue
Block a user