$|$
This commit is contained in:
@@ -28,4 +28,24 @@ internal static class Extension
|
||||
size.Width = new(h.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Возвращает индекс указанного элемента в коллекции.
|
||||
/// </summary>
|
||||
/// <param name="list">Коллекция элементов.</param>
|
||||
/// <param name="element">Элемент для поиска.</param>
|
||||
/// <returns>Индекс элемента, или -1, если элемент не найден.</returns>
|
||||
public static int IndexOf(this OpenXmlElementList list, OpenXmlElement element)
|
||||
{
|
||||
if (list == null || element == null)
|
||||
return -1;
|
||||
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
if (list[i] == element)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using QWERTYkez.WordProcessor;
|
||||
|
||||
namespace QWERTYkez.WordProcessor;
|
||||
namespace QWERTYkez.WordProcessor;
|
||||
|
||||
public interface IWordWriter : IWordReader
|
||||
{
|
||||
@@ -23,6 +21,25 @@ public interface IWordWriter : IWordReader
|
||||
void ReplaceToTable(string oldValue, Action<ITable> buildTable);
|
||||
void ReplaceToTable(string oldValue, FontProps baseFont, Action<ITable> buildTable);
|
||||
void ReplaceToText(string oldValue, Action<IText> buildText);
|
||||
|
||||
|
||||
|
||||
|
||||
void ReplaceString(string oldValue, Func<string, string> newValues);
|
||||
void ReplaceString(string oldValue, Func<string, IEnumerable<string>> newValues);
|
||||
void ReplaceString(string oldValue, Func<string, string[]> newValues);
|
||||
|
||||
void ReplaceItem(string oldValue, Func<string, ReplaceItem> newValues);
|
||||
void ReplaceItem(string oldValue, Func<string, IEnumerable<ReplaceItem>> newValues);
|
||||
void ReplaceItem(string oldValue, Func<string, ReplaceItem[]> newValues);
|
||||
|
||||
void ReplaceToTable(string oldValue, Action<string, ITable> buildTable);
|
||||
void ReplaceToTable(string oldValue, FontProps baseFont, Action<string, ITable> buildTable);
|
||||
void ReplaceToText(string oldValue, Action<string, IText> buildText);
|
||||
|
||||
|
||||
|
||||
|
||||
void Save();
|
||||
void SaveTo(string path);
|
||||
Task SaveToAsync(string path, CancellationToken cancellationToken = default);
|
||||
|
||||
@@ -8,4 +8,5 @@ global using System.IO;
|
||||
global using System.Linq;
|
||||
global using System.Text;
|
||||
global using System.Threading;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Text.RegularExpressions;
|
||||
Reference in New Issue
Block a user