SubtitleEdit/libse/ReplaceExpression.cs

32 lines
1.0 KiB
C#
Raw Normal View History

2018-03-09 23:42:32 +01:00
namespace Nikse.SubtitleEdit.Core
{
public class ReplaceExpression
{
public const int SearchNormal = 0;
public const int SearchRegEx = 1;
public const int SearchCaseSensitive = 2;
public const string SearchTypeNormal = "Normal";
public const string SearchTypeCaseSensitive = "CaseSensitive";
public const string SearchTypeRegularExpression = "RegularExpression";
public string FindWhat { get; set; }
public string ReplaceWith { get; set; }
public int SearchType { get; set; }
public ReplaceExpression(string findWhat, string replaceWith, string searchType)
{
FindWhat = findWhat;
ReplaceWith = replaceWith;
if (string.CompareOrdinal(searchType, SearchTypeRegularExpression) == 0)
2019-01-19 14:40:37 +01:00
{
2018-03-09 23:42:32 +01:00
SearchType = SearchRegEx;
2019-01-19 14:40:37 +01:00
}
2018-03-09 23:42:32 +01:00
else if (string.CompareOrdinal(searchType, SearchTypeCaseSensitive) == 0)
2019-01-19 14:40:37 +01:00
{
2018-03-09 23:42:32 +01:00
SearchType = SearchCaseSensitive;
2019-01-19 14:40:37 +01:00
}
2018-03-09 23:42:32 +01:00
}
}
}