#region License
// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
// This source code is made available under the terms of the GNU Lesser General Public License v3.0
// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
#endregion
using System;
namespace MiniSqlQuery.Core
{
///
/// A class that encapsulates a "find text" request, storing the position
///
public class FindTextRequest
{
///
/// The _replace value.
///
private static string _replaceValue;
///
/// The _search value.
///
private static string _searchValue;
///
/// Initializes a new instance of the class. Creates a new request using the specified for searching.
///
/// The search provider for this request,
public FindTextRequest(IFindReplaceProvider textProvider)
: this(textProvider, null)
{
}
///
/// Initializes a new instance of the class. Creates a new request using the specified for searching.
///
/// The search provider for this request,
/// The text to be searched on.
public FindTextRequest(IFindReplaceProvider textProvider, string searchValue)
{
TextProvider = textProvider;
if (searchValue != null)
{
SearchValue = searchValue;
}
Position = 0;
StringComparison = StringComparison.CurrentCultureIgnoreCase;
}
///
/// Gets or sets the position of the currently "found" text (or the starting position of the search).
///
/// The position.
public int Position { get; set; }
///
/// Gets or sets the text replace value (shared value).
///
/// The replace value.
public string ReplaceValue
{
get { return _replaceValue; }
set { _replaceValue = value; }
}
///
/// Gets or sets the search text (shared value).
///
/// The search value.
public string SearchValue
{
get { return _searchValue; }
set { _searchValue = value; }
}
/*
///
/// If true, signals the to search "up", otherwise "down".
///
/// True to search up, false for down (the default).
public bool SearchUp { get; set; }
*/
///
/// Gets or sets the string comparison settings, e.g. case insensitive.
///
/// The string comparison.
public StringComparison StringComparison { get; set; }
///
/// Gets or sets the search provider. A search request is conducted by the provider, different providers
/// can yield different results, for example plain text or a regular expression searcher.
///
/// The text provider.
public IFindReplaceProvider TextProvider { get; set; }
}
}