• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CheckType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CheckType的典型用法代码示例。如果您正苦于以下问题:C# CheckType类的具体用法?C# CheckType怎么用?C# CheckType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CheckType类属于命名空间,在下文中一共展示了CheckType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: ProcessStreamFlags

        private void ProcessStreamFlags()
        {
            byte[] streamFlags = _reader.ReadBytes(2);
            UInt32 crc = _reader.ReadLittleEndianUInt32();
            UInt32 calcCrc = Crc32.Compute(streamFlags);
            if (crc != calcCrc)
                throw new InvalidDataException("Stream header corrupt");

            BlockCheckType = (CheckType)(streamFlags[1] & 0x0F);
            byte futureUse = (byte)(streamFlags[1] & 0xF0);
            if (futureUse != 0 || streamFlags[0] != 0)
                throw new InvalidDataException("Unknown XZ Stream Version");
        }
开发者ID:sambott,项目名称:XZ.NET,代码行数:13,代码来源:XZHeader.cs


示例17: checkForCheckMatch

 /// <summary>
 /// check to see if any checks in a subcategory match a given check
 /// </summary>
 /// <param name="subcategory"></param>
 /// <param name="type"></param>
 /// <param name="value"></param>
 /// <param name="contains"></param>
 /// <param name="equality"></param>
 /// <param name="invert"></param>
 /// <returns>true if there is a matching check in the category</returns>
 public static bool checkForCheckMatch(customSubCategory subcategory, CheckType type, string value, bool invert = false, bool contains = true, Check.Equality equality = Check.Equality.Equals)
 {
     for (int j = 0; j < subcategory.filters.Count; j++)
     {
         Filter f = subcategory.filters[j];
         for (int k = 0; k < f.checks.Count; k++)
         {
             Check c = f.checks[k];
             if (c.type == type && c.value == value && c.invert == invert && c.contains == contains && c.equality == equality)
                 return true;
         }
     }
     return false;
 }
开发者ID:Felbourn,项目名称:FilterExtension,代码行数:24,代码来源:customSubCategory.cs


示例18: pattern_Expand

 internal void pattern_Expand(Type expectedException, CheckType checkType)
 {
     string call = "Expand()";
     try
     {
         m_pattern.Expand();
         System.Threading.Thread.Sleep(1);
     }
     catch (Exception actualException)
     {
         TestException(expectedException, actualException, call, checkType);
         return;
     }
     TestNoException(expectedException, call, checkType);
 }
开发者ID:TestStack,项目名称:UIAVerify,代码行数:15,代码来源:ExpandCollapseTests.cs


示例19: patternToggle

        /// -------------------------------------------------------------------
        /// <summary></summary>
        /// -------------------------------------------------------------------
        internal void patternToggle(Type expectedException, CheckType checkType)
        {
            string call = "Toggle()";
            try
            {
                _pattern.Toggle();
            }
            catch (Exception actualException)
            {
                if (Library.IsCriticalException(actualException))
                    throw;

                TestException(expectedException, actualException, call, checkType);
                return;
            }
            TestNoException(expectedException, call, checkType);
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:20,代码来源:ToggleTests.cs


示例20: CheckLogs

 public CheckLogs(Employee employee, CheckType CheckType, DateTime temptime)
 {
     if (employee == null) throw new CheckLogsException();
     if (employee.Logs==null)
     {
         employee.Logs = new List<CheckLogs>();
     }
     //Remove Seconds
     //DateTime CheckTime = temptime.AddSeconds(-temptime.Second);
     DateTime CheckTime = temptime;
     this.CheckTime = CheckTime;
     this.CheckType = CheckType;
     _employee = employee;
     var _localtion = GPSHelper.GetInstance().GetLocation();
     x = Convert.ToDouble(_localtion.Latitude.ToString());
     y = Convert.ToDouble(_localtion.Longitude.ToString());
     employee.Logs.Add(this);
 }
开发者ID:CarolineCao,项目名称:example_timePilot,代码行数:18,代码来源:CheckLogs.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CheckedExpression类代码示例发布时间:2022-05-24
下一篇:
C# CheckState类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap