当前位置: 首页>>代码示例>>C#>>正文


C# CheckType类代码示例

本文整理汇总了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);
 }
开发者ID:keyvan,项目名称:AspNetClientBlocker,代码行数:13,代码来源:XmlDataProvider.cs

示例2: CustomSecurityCheckAttribute

 public CustomSecurityCheckAttribute(CheckType type)
 {
     CheckList.Add(new CheckItem
     {
         Type = type
     });
 }
开发者ID:kiszu,项目名称:ForBlog,代码行数:7,代码来源:CustomSecurityCheckAttribute.cs

示例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);
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:34,代码来源:ValueTests.cs

示例4: NPCChecks

        public NPCChecks(CheckType check, params object[] p)
        {
            Type = check;

            for (int i = 0; i < p.Length; i++)
                Params.Add(p[i]);
        }
开发者ID:xiaofengzhiyu,项目名称:CSharpMir,代码行数:7,代码来源:NPCObject.cs

示例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;
        }
开发者ID:steve-stanton,项目名称:backsight,代码行数:14,代码来源:RingCheck.cs

示例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;
        }
开发者ID:steve-stanton,项目名称:backsight,代码行数:14,代码来源:TextCheck.cs

示例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);
        }
开发者ID:letmeproperty,项目名称:Properties,代码行数:8,代码来源:EnumHelper_TestFixture.cs

示例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;
        }
开发者ID:steve-stanton,项目名称:backsight,代码行数:14,代码来源:DividerCheck.cs

示例9: ParseCheckType_ReturnsCorrectString

        public void ParseCheckType_ReturnsCorrectString(CheckType checkType, string expected)
        {
            //act
            var result = EnumFactory.ParseCheckType(checkType);

            //assert
            result.Should().Be(expected);
        }
开发者ID:letmeproperty,项目名称:Properties,代码行数:8,代码来源:EnumFactory_TestFixture.cs

示例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;
 }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:8,代码来源:IValidation.cs

示例11: IsRepeate

 public static bool IsRepeate(CheckType t,string value)
 {
     switch(t){
         case CheckType.TagName:
             return IsTagNameRepeate(value);
         default:
             return false;
     }                
 }
开发者ID:mengweifeng,项目名称:BaWuClub.Web,代码行数:9,代码来源:CheckController.cs

示例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;
        }
开发者ID:TestStack,项目名称:UIAVerify,代码行数:12,代码来源:SelectionTests.cs

示例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;
        }
开发者ID:philt5252,项目名称:GoldenHorse,代码行数:55,代码来源:DefaultNameHelper.cs

示例14: CheckTypeToNotation

        public static string CheckTypeToNotation(CheckType checkType)
        {
            switch (checkType)
            {
                case CheckType.Check:
                    return "+";
                case CheckType.CheckAndMate:
                    return "#";
            }

            return "";
        }
开发者ID:ThorMutoAsmund,项目名称:BasicChess,代码行数:12,代码来源:HistoricalChessMove.cs

示例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;
 }
开发者ID:a1ien,项目名称:WoWPacketViewer,代码行数:12,代码来源:FrmWardenDebug.cs


注:本文中的CheckType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。