Source/Editors/Primitives/StartsWithPredicate.cs
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
#if FRAMEWORK20
using System;
using System.Collections.Generic;
using System.Text;
namespace DevComponents.Editors.Primitives
{
internal class StartsWithPredicate
{
private string _Prefix;
private int _MaxMatches = 0;
private int _MatchCount = 0;
// Initializes with prefix we want to match.
public StartsWithPredicate(string prefix)
{
_Prefix = prefix;
}
// Initializes with prefix we want to match.
public StartsWithPredicate(string prefix, int maxMatches)
{
_Prefix = prefix;
_MaxMatches = maxMatches;
}
// Sets a different prefix to match.
public string Prefix
{
get { return _Prefix; }
set { _Prefix = value; }
}
public void ResetMatchCount()
{
_MatchCount = 0;
}
public int MaxMatches
{
get { return _MaxMatches; }
set
{
_MaxMatches = value;
}
}
// Gets the predicate.
public Predicate<string> Match
{
get { return IsMatch; }
}
private bool IsMatch(string s)
{
return s.ToLower().StartsWith(_Prefix);
}
public Predicate<string> MatchTop
{
后面还有 17 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。