本文整理汇总了C#中CheckType类的典型用法代码示例。如果您正苦于以下问题:C# CheckType类的具体用法?C# CheckType怎么用?C# CheckType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CheckType类属于命名空间,在下文中一共展示了CheckType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckSingleIP
/// <summary>
/// Checks a single IP.
/// </summary>
/// <param name="ip">IP to check.</param>
/// <param name="type">Check type.</param>
/// <returns>Returns true if IP could be found in the list and false if it couldn't be found.</returns>
public override bool CheckSingleIP(string ip, CheckType type)
{
if (type == CheckType.Trusted)
return IsTrusted(ip, ValidationType.Single);
else
return IsBlocked(ip, ValidationType.Single);
}
示例2: CustomSecurityCheckAttribute
public CustomSecurityCheckAttribute(CheckType type)
{
CheckList.Add(new CheckItem
{
Type = type
});
}
示例3: pattern_SetValue
/// -------------------------------------------------------------------
/// <summary></summary>
/// -------------------------------------------------------------------
internal void pattern_SetValue(object val, Type expectedException, CheckType checkType)
{
string newVal = Convert.ToString(val, CultureInfo.CurrentUICulture);
string call = "SetValue(" + newVal + ")";
try
{
Comment("Before " + call + " Value = " + pattern_Value);
_pattern.SetValue(newVal);
Comment("After " + call + " Value = " + pattern_Value);
// Are we in a "no-clobber" state? If so, bail gracefully
// This is why we throw an IncorrectElementConfiguration instead of
// default value of checkType
if (_noClobber == true)
{
ThrowMe(CheckType.IncorrectElementConfiguration, "/NOCLOBBER flag is set, cannot update the value of the control, exiting gracefully");
}
}
catch (Exception actualException)
{
if (Library.IsCriticalException(actualException))
throw;
TestException(expectedException, actualException, call, checkType);
return;
}
TestNoException(expectedException, call, checkType);
}
示例4: NPCChecks
public NPCChecks(CheckType check, params object[] p)
{
Type = check;
for (int i = 0; i < p.Length; i++)
Params.Add(p[i]);
}
示例5: RingCheck
/// <summary>
/// Creates a new <c>RingCheck</c> that relates to the specified polygon ring.
/// </summary>
/// <param name="ring">The polygon ring the check relates to (not null).</param>
/// <param name="types">The type(s) of check this item corresponds to</param>
/// <exception cref="ArgumentNullException">If <paramref name="ring"/> is null</exception>
internal RingCheck(Ring ring, CheckType types)
: base(types)
{
if (ring==null)
throw new ArgumentNullException();
m_Ring = ring;
}
示例6: TextCheck
/// <summary>
/// Creates a new <c>TextCheck</c> that relates to the specified text.
/// </summary>
/// <param name="label">The text the check relates to (not null).</param>
/// <param name="types">The type(s) of check this item corresponds to</param>
/// <exception cref="ArgumentNullException">If <paramref name="label"/> is null</exception>
internal TextCheck(TextFeature label, CheckType types)
: base(types)
{
if (label==null)
throw new ArgumentNullException();
m_Label = label;
}
示例7: EnumHelper_Parse_ReturnsCorrectEnum
public void EnumHelper_Parse_ReturnsCorrectEnum(string value, CheckType checkType)
{
//act
var result = EnumHelper<CheckType>.Parse(value);
//assert
result.Should().Be(checkType);
}
示例8: DividerCheck
/// <summary>
/// Creates a new <c>DividerCheck</c> that relates to the specified divider.
/// </summary>
/// <param name="divider">The divider the check relates to (not null).</param>
/// <param name="types">The type(s) of check this item corresponds to</param>
/// <exception cref="ArgumentNullException">If <paramref name="divider"/> is null</exception>
internal DividerCheck(IDivider divider, CheckType types)
: base(types)
{
if (divider==null)
throw new ArgumentNullException();
m_Divider = divider;
}
示例9: ParseCheckType_ReturnsCorrectString
public void ParseCheckType_ReturnsCorrectString(CheckType checkType, string expected)
{
//act
var result = EnumFactory.ParseCheckType(checkType);
//assert
result.Should().Be(expected);
}
示例10: FieldNameCheck
public FieldNameCheck(string FieldName, CheckType[] Types, string[] ErrMsgs, OutputError Output, object[] Other)
{
this.FieldName = FieldName;
this.Types = Types;
this.ErrMsgs = ErrMsgs;
this.Params = Other;
this.Output = Output;
}
示例11: IsRepeate
public static bool IsRepeate(CheckType t,string value)
{
switch(t){
case CheckType.TagName:
return IsTagNameRepeate(value);
default:
return false;
}
}
示例12: getSelectionItemPattern
/// -------------------------------------------------------------------
/// <summary></summary>
/// -------------------------------------------------------------------
internal SelectionItemPattern getSelectionItemPattern(AutomationElement element, CheckType checkType)
{
SelectionItemPattern sip = (SelectionItemPattern)element.GetCurrentPattern(SelectionItemPattern.Pattern);
if (sip == null)
ThrowMe(checkType, "\"" + Library.GetUISpyLook(element) + " does not support SelectionItemPattern");
return sip;
}
示例13: GetDefaultName
public static string GetDefaultName(string locationToCheck, string prefix, CheckType checkType = CheckType.Directory)
{
if (!Directory.Exists(locationToCheck))
Directory.CreateDirectory(locationToCheck);
IEnumerable<string> enumerable;
if (checkType == CheckType.Directory)
enumerable = Directory.EnumerateDirectories(locationToCheck);
else
enumerable = Directory.EnumerateFiles(locationToCheck);
int[] projectNums = enumerable
.Select(
dir =>
{
string name;
if (checkType == CheckType.Directory)
{
DirectoryInfo dirInfo = new DirectoryInfo(dir);
name = dirInfo.Name;
}
else
{
FileInfo fileInfo = new FileInfo(dir);
name = fileInfo.Name.Substring(0, fileInfo.Name.Length - fileInfo.Extension.Length);
}
string pattern = @"^" + prefix + @"(\d+)$";
if (!Regex.IsMatch(name, pattern))
return 0;
string value = Regex.Match(name, pattern).Groups[1].Value;
return int.Parse(value);
})
.OrderBy(i => i).ToArray();
int num = 1;
foreach (int projectNum in projectNums)
{
if (projectNum == num)
{
num++;
}
else
{
break;
}
}
string newName = prefix + num;
return newName;
}
示例14: CheckTypeToNotation
public static string CheckTypeToNotation(CheckType checkType)
{
switch (checkType)
{
case CheckType.Check:
return "+";
case CheckType.CheckAndMate:
return "#";
}
return "";
}
示例15: GetByteForCheckType
private static bool GetByteForCheckType(CheckType checkType, ref byte val, IEnumerable<KeyValuePair<byte, CheckType>> dictionary)
{
foreach (var temp in dictionary)
{
if (temp.Value == checkType)
{
val = temp.Key;
return true;
}
}
return false;
}