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

C# CompareType类代码示例

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

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



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

示例1: Is

 public QueryBuilder Is(CompareType compareType, string value)
 {
     _compareCondition.Compare = compareType;
     _compareCondition.Value = value;
     _query.Conditions.Add(_compareCondition);
     return _queryBuilder;
 }
开发者ID:EelcoMulder,项目名称:FluentApi.QueryBuilder.Example,代码行数:7,代码来源:CompareConditionBuilder.cs


示例2: ComparePredicate

        public ComparePredicate(IDataSelector firstArgumentSelector, IDataSelector secondArgumentSelector, CompareType type)
        {
            Contract.Requires(firstArgumentSelector != null);
            Contract.Requires(secondArgumentSelector != null);

            _firstArgumentSelector = firstArgumentSelector;
            _secondArgumentSelector = secondArgumentSelector;

            switch (type)
            {
                case CompareType.Less:
                    _checkComparisonResult = r => r < 0;
                    break;
                case CompareType.LessOrEqual:
                    _checkComparisonResult = r => r <= 0;
                    break;
                case CompareType.Greater:
                    _checkComparisonResult = r => r > 0;
                    break;
                case CompareType.GreaterOrEqual:
                    _checkComparisonResult = r => r >= 0;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("type");
            }
        }
开发者ID:snowbear,项目名称:XmlQuery,代码行数:26,代码来源:ComparePredicate.cs


示例3: AttendanceTypeAsOf

 internal static Expression AttendanceTypeAsOf(
     ParameterExpression parm,
     DateTime? from,
     DateTime? to,
     int? progid,
     int? divid,
     int? org,
     int orgtype,
     CompareType op,
     params int[] ids)
 {
     to = to.HasValue ? to.Value.AddDays(1) : from.Value.AddDays(1);
     Expression<Func<Person, bool>> pred = p => (
         from a in p.Attends
         where a.MeetingDate >= @from
         where a.MeetingDate < to
         where (a.AttendanceFlag
                 || (ids.Length == 1 && ids[0] == AttendTypeCode.Offsite))
         where ids.Contains(a.AttendanceTypeId ?? 0)
         where orgtype == 0 || a.Meeting.Organization.OrganizationTypeId == orgtype
         where org == 0 || a.Meeting.OrganizationId == org
         where divid == 0 || a.Meeting.Organization.DivOrgs.Any(dg => dg.DivId == divid)
         where progid == 0 || a.Meeting.Organization.DivOrgs.Any(dg => dg.Division.ProgDivs.Any(pg => pg.ProgId == progid))
         select a
         ).Any();
     Expression expr = Expression.Invoke(pred, parm);
     if (op == CompareType.NotEqual || op == CompareType.NotOneOf)
         expr = Expression.Not(expr);
     return expr;
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:30,代码来源:Expressions.cs


示例4: getAnalysisResults

        /// <summary>
        /// Get all attributes with probability comparison
        /// </summary>
        /// <param name="strJobTitle">Job title to get attributes</param>
        /// <param name="compareType">Compare Type</param>
        /// <param name="compareValue">Value to compare</param>
        /// <param name="compareValue2">Value to compare 2 [optional]</param>
        /// <returns>The attributes appropriate probability comparison</returns>
        public static List<DecisionTreeAnalysisResult> getAnalysisResults(string strModelName, CompareType compareType, double compareValue, double compareValue2 = -1)
        {
            if (compareValue < 0 || compareValue > 1)
            {
                throw new Exception("compareValue variable value must be between 0-1");
            }
            if ((compareType == CompareType.Between || compareType == CompareType.NotBetween) && (compareValue2 > 1 || compareValue2 < 0))
            {
                throw new Exception("compareValue2 variable value must be between 0-1");
            }

            if (!existsModelName(strModelName))
            {
                throw new Exception("Model Name doesn't exists! (If model name existed, please check connection!)");
            }
            try
            {
                //Get all leaves with Probability and Model Name
                List<DecisionTreeNode> nodes = getDecisionTreeNodeWithProbability(strModelName, compareType, compareValue, compareValue2);
                List<DecisionTreeAnalysisResult> results = new List<DecisionTreeAnalysisResult>();
                foreach (DecisionTreeNode node in nodes)
                {
                    DecisionTreeAnalysisResult result = new DecisionTreeAnalysisResult(new NodeDescription(node), node);
                    results.Add(result);
                }
                return results;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:khanhduy94,项目名称:jobzoom,代码行数:40,代码来源:DecisionTreeAnalysis.cs


示例5: HeapArray

 // Post: ((size() == 0) && ! locked())
 // Pre = PreCondition, Post = PostCondition
 public HeapArray(CompareType c)
 {
     m_Heap = new List<Linker>();
     m_Finder = new List<uint>();
     m_Locked = false;
     m_Compare = c;
 }
开发者ID:blahblahblahblah831,项目名称:brawltools2,代码行数:9,代码来源:HeapArray.cs


示例6: Compare

 public Compare(CompareType type, CompareOption option, string fieldName, params object[] compareValues)
 {
     this.Type = type;
     this.Field = fieldName;
     this.CompareValues = compareValues;
     this.Option = option;
 }
开发者ID:burstinair,项目名称:burst.net,代码行数:7,代码来源:Compare.cs


示例7: DateGreaterThanAttribute

 public DateGreaterThanAttribute(string firstDate, string secondDate, CompareType type)
     : base()
 {
     FirstDate = firstDate;
     SecondDate = secondDate;
     Compare = type;
 }
开发者ID:TeamENVISION,项目名称:ImageContestSystem-Web-App,代码行数:7,代码来源:DateGreaterThanAttribute.cs


示例8: CompareConstant

 internal static Expression CompareConstant(ParameterExpression parm, string prop, CompareType op, object value)
 {
     if (value != null)
         if (value.GetType() == typeof(int[])) // use isarray?
             return CompareContains(parm, prop, op, value, typeof(int[]), typeof(int));
         else if (value.GetType() == typeof(string[]))
             return CompareContains(parm, prop, op, value, typeof(string[]), typeof(string));
     var left = Expression.Property(parm, prop);
     var right = Expression.Convert(Expression.Constant(value), left.Type);
     return Compare(parm, left, op, right);
 }
开发者ID:vanutama,项目名称:bvcms,代码行数:11,代码来源:Expressions.cs


示例9: IVFilter

 public IVFilter()
 {
     hpValue = 0;
     hpCompare = CompareType.None;
     atkValue = 0;
     atkCompare = CompareType.None;
     defValue = 0;
     defCompare = CompareType.None;
     spaValue = 0;
     spaCompare = CompareType.None;
     spdValue = 0;
     spdCompare = CompareType.None;
     speValue = 0;
     speCompare = CompareType.None;
 }
开发者ID:Slashmolder,项目名称:RNGReporter,代码行数:15,代码来源:IVFilter.cs


示例10: CompareAgainst

 public static bool CompareAgainst(this int compareTo, CompareType compareType, int value)
 {
     switch (compareType)
     {
         case CompareType.Greater:
             return value > compareTo;
         case CompareType.GEqual:
             return value >= compareTo;
         case CompareType.Less:
             return value < compareTo;
         case CompareType.LEqual:
             return value <= compareTo;
         default: // EQUAL
             return value == compareTo;
     }
 }
开发者ID:TrinketBen,项目名称:Courier,代码行数:16,代码来源:UtilitiesComparison.cs


示例11: checkFlag

 public bool checkFlag(string compareValue, CompareType compareType)
 {
     switch(this.flagType)
     {
         case FlagType.boolFlag:
             switch(compareType)
             {
                 case CompareType.Equal:
                     return checkFlag_BoolEqual(compareValue);
                 case CompareType.NotEqual:
                     return checkFlag_BoolNotEqual(compareValue);
                 default: return false;
             }
         case FlagType.intFlag:
             switch(compareType)
             {
                 case CompareType.Equal:
                     return checkFlag_IntEqual(compareValue);
                 case CompareType.Less:
                     return checkFlag_IntLess(compareValue);
                 case CompareType.LessEqual:
                     return checkFlag_IntLessEqual(compareValue);
                 case CompareType.Greater:
                     return checkFlag_IntGreater(compareValue);
                 case CompareType.GreaterEqual:
                     return checkFlag_IntGreaterEqal(compareValue);
                 default: return false;
             }
        
         case FlagType.stringFlag:
              switch(compareType)
             {
                  case CompareType.Equal:
                     return checkFlag_StringEqual(compareValue);
                  case CompareType.Contains:
                     return checkFlag_StringContains(compareValue);
                  case CompareType.Subset:
                     return checkFlag_StringSubstring(compareValue);
                  default:
                     return false;
             }
             
         default:
              return false;
     }
 }
开发者ID:mengtest,项目名称:UnityRPG,代码行数:46,代码来源:GlobalFlags.cs


示例12: CompareName

 private int CompareName(string original, string compare, CompareType compareType)
 {
     original = original.ToLower();
     compare = compare.ToLower();
     int charInCommon = 0;
     if (compare != original)
     {
         foreach (char originalChar in original.ToCharArray())
         {
             int index;
             if ((index = compare.IndexOf(originalChar.ToString()))>=0 && originalChar != ' ')
             {
                 charInCommon++;
                 if(compareType == CompareType.Distinct)  compare = compare.Replace(originalChar, ' ');
                 if (compareType == CompareType.Total) compare.Remove(index, 1);
             }
         }
     }
     return charInCommon;
 }
开发者ID:LimeyJohnson,项目名称:RandomProjects,代码行数:20,代码来源:Name.aspx.cs


示例13: CompareColor

 public CompareColor(CompareType value)
 {
     Value = value;
 }
开发者ID:Zelenov,项目名称:ColorGraph,代码行数:4,代码来源:Colors.cs


示例14: RequireLevel

 public RequireLevel(int level, CompareType type)
 {
     Instructions = new List<TreeCrayonInstruction>();
     Level = level;
     Type = type;
 }
开发者ID:idaohang,项目名称:Helicopter-Autopilot-Simulator,代码行数:6,代码来源:RequireLevel.cs


示例15: SetPlusParentsOf

 internal void SetPlusParentsOf(CompareType op, bool tf)
 {
     var c = this;
     while (c.Parent != null)
         c = c.Parent;
     c.PlusParentsOf = ((tf && op == CompareType.Equal) || (!tf && op == CompareType.NotEqual));
 }
开发者ID:clearfunction,项目名称:bvcms,代码行数:7,代码来源:Condition.cs


示例16: SetComparisonType

 public void SetComparisonType(CompareType value)
 {
     Comparison = value.ToString();
     compare = null;
     compare = Compare2;
 }
开发者ID:clearfunction,项目名称:bvcms,代码行数:6,代码来源:Condition.cs


示例17: AddNewClause

 public Condition AddNewClause(QueryType type, CompareType op, object value = null)
 {
     var c = AddNewClause();
     c.SetQueryType(type);
     c.SetComparisonType(op);
     if (type == QueryType.MatchAnything || type == QueryType.MatchNothing)
     {
         c.CodeIdValue = "1,true";
         return c;
     }
     if (type == QueryType.HasMyTag)
     {
         c.Tags = value.ToString();
         c.CodeIdValue = "1,true";
         return c;
     }
     switch (c.FieldInfo.Type)
     {
         case FieldType.NullBit:
         case FieldType.Bit:
         case FieldType.Code:
         case FieldType.NullCode:
         case FieldType.CodeStr:
             c.CodeIdValue = value.ToString();
             break;
         case FieldType.Date:
         case FieldType.DateSimple:
             c.DateValue = (DateTime?)value;
             break;
         case FieldType.Number:
         case FieldType.NullNumber:
         case FieldType.NullInteger:
         case FieldType.String:
         case FieldType.StringEqual:
         case FieldType.Integer:
         case FieldType.IntegerSimple:
         case FieldType.IntegerEqual:
             c.TextValue = value.ToString();
             break;
         default:
             throw new ArgumentException("type not allowed");
     }
     return c;
 }
开发者ID:clearfunction,项目名称:bvcms,代码行数:44,代码来源:Condition.cs


示例18: SelectOperation

 protected string SelectOperation(CompareType compareType)
 {
     switch (compareType)
     {
         case CompareType.And:
             return "AND";
         case CompareType.Equal:
             return "=";
         case CompareType.GreaterThan:
             return ">";
         case CompareType.GreaterThanOrEqual:
             return ">=";
         case CompareType.LessThan:
             return "<";
         case CompareType.LessThanOrEqual:
             return "<=";
         case CompareType.Or:
             return "OR";
         case CompareType.Add:
             return "+";
         case CompareType.Substarct:
             return "-";
         case CompareType.Multiply:
             return "*";
         case CompareType.Divide:
             return "/";
         case CompareType.NotEqual:
             return "<>";
         default:
             throw new Exception();
     }
 }
开发者ID:dusdong,项目名称:BaseComponent,代码行数:32,代码来源:SqlBuilderBase.cs


示例19: Find

 public void Find(string word, CompareType mode, Action<string> onFound)
 {
     switch (mode)
     {
         case CompareType.CaseInsensitive:
             word = word.ToLowerInvariant();
             break;
         case CompareType.IgnoreDiacritics:
             word = word.RemoveDiacritics();
             break;
         case CompareType.IgnoreCaseAndDiacritics:
             word = word.ToLowerInvariant().RemoveDiacritics();
             break;
     }
     var sb = new StringBuilder();
     Match(word, mode, sb, 0, ofs =>
     {
         if (word.Length != sb.Length) return;
         ofs = SinkTo(ofs, ':');
         if (ofs == -1) return;
         sb.Append(":");
         IterateRaw(sb, ofs, sb1 => onFound(ExpandByType(sb1)));
         sb.Length--;
     });
     Match(word, mode, sb, _nodePrefix, ofs =>
     {
         if (ofs != -1) ofs = SinkTo(ofs, ':');
         if (ofs == -1) return;
         Match(word, mode, sb, _nodePostfix, ofs2 =>
         {
             if (word.Length != sb.Length) return;
             ofs2 = SinkTo(ofs2, ':');
             if (ofs2 == -1) return;
             sb.Append(":");
             IterateRaw(sb, ofs2, sb1 => onFound(ExpandByType(sb1)));
             sb.Length--;
         });
     });
 }
开发者ID:Bobris,项目名称:Najka,代码行数:39,代码来源:FsaNajka.cs


示例20: DecodeChar

 char DecodeChar(int ofs, CompareType mode)
 {
     return _id2ConvertedChar[(int)mode][_tree[ofs] & 127];
 }
开发者ID:Bobris,项目名称:Najka,代码行数:4,代码来源:FsaNajka.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Comparison类代码示例发布时间:2022-05-24
下一篇:
C# CompareTool类代码示例发布时间: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