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


C# Op类代码示例

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


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

示例1: NotationValue

        public NotationValue(string notation, int index, int end)
        {
            value = 1;
            op = Op.Add;
            type = NotationType.Value;

            switch (notation[index])
            {
                case '+': { index++; break; }
                case '-': { op = Op.Sub; index++; break; }
                case '*': { op = Op.Mul; index++; break; }
                case '/': { op = Op.Div; index++; break; }
                case '^': { op = Op.Mod; index++; break; }
            }

            if (index <= end && char.IsDigit(notation[index]))
            {
                int i = index + 1;
                while (i <= end && char.IsDigit(notation[i])) i++;
                value = int.Parse(notation.Substring(index, i - index));
                index = i;
            }

            if (index <= end && char.IsLetter(notation[index]))
            {
                Enum.TryParse<NotationType>(notation.Substring(index, end - index + 1), out type);
            }
        }
开发者ID:mrlamb,项目名称:5eCharGen,代码行数:28,代码来源:Notation.cs

示例2: CreateFragment

        /// <summary>
        /// 创建查询条件片段。
        /// </summary>
        /// <param name="propertyName">属性名</param>
        /// <param name="op">查询操作</param>
        /// <returns>2元组:结果一、查询条件片段;结果二、查询参数</returns>
        protected override Tuple<string, string> CreateFragment(string propertyName, Op op)
        {
            var criteria = string.Empty;
            var parameterName = string.Empty;

            switch (op)
            {
                case Op.Eq:
                case Op.Gt:
                case Op.Ge:
                case Op.Lt:
                case Op.Le:
                    parameterName = propertyName + (this._parameterIndex++);
                    criteria = string.Format(CriteriaFormat, propertyName, Operations[(int)op], parameterName);

                    break;
                case Op.Like:
                    parameterName = propertyName + (this._parameterIndex++);
                    criteria = $"\"{propertyName}\" LIKE '%'||:{parameterName}||'%'";

                    break;
                case Op.IsNull:
                    criteria = $"\"{propertyName}\" IS NULL";

                    break;
                case Op.IsNotNull:
                    criteria = $"\"{propertyName}\" IS NOT NULL";

                    break;
            }

            return new Tuple<string, string>(criteria, parameterName);
        }
开发者ID:fenglinz,项目名称:Sparrow,代码行数:39,代码来源:PostgreSQLDynamicQueryProvider.cs

示例3: Main

  static void Main() 
  {
    Op.sanity_check();
    {
      Op op = new Op(100);
      Op opNew = op++;
      if (op.i != 101) throw new Exception("operator++ postfix failed (op)");
      if (opNew.i != 100) throw new Exception("operator++ postfix failed (opNew)");
    }
    {
      Op op = new Op(100);
      Op opNew = op--;
      if (op.i != 99) throw new Exception("operator-- postfix failed (op)");
      if (opNew.i != 100) throw new Exception("operator-- postfix failed (opNew)");
    }
    {
      Op op = new Op(100);
      Op opNew = ++op;
      if (op.i != 101) throw new Exception("operator++ prefix failed (op)");
      if (opNew.i != 101) throw new Exception("operator++ prefix failed (opNew)");
    }
    {
      Op op = new Op(100);
      Op opNew = --op;
      if (op.i != 99) throw new Exception("operator-- prefix failed (op)");
      if (opNew.i != 99) throw new Exception("operator-- prefix failed (opNew)");
    }

    // overloaded operator class
    Op k = new OpDerived(3);
    int check_k = k.IntCast();
    Assert(check_k == 6);
  }
开发者ID:Reticulatas,项目名称:MochaEngineFinal,代码行数:33,代码来源:operator_overload_runme.cs

示例4: BinaryTerm

 private BinaryTerm(RiakFluentSearch search, string field, Op op, Term left)
     : base(search, field)
 {
     _op = op;
     _left = left;
     left.Owner = this;
 }
开发者ID:taliesins,项目名称:CorrugatedIron,代码行数:7,代码来源:BinaryTerm.cs

示例5: Condition

 /// <summary>
 /// 构造方法。
 /// </summary>
 /// <param name="column">属性</param>
 /// <param name="op">操作</param>
 /// <param name="value">值</param>
 internal Condition(string column, Op op, object value)
 {
     this.Op = op;
     this.Value = value;
     this.JoinType = "AND";
     this.PropertyName = column;
 }
开发者ID:fenglinz,项目名称:Sparrow,代码行数:13,代码来源:Condition.cs

示例6: Operator

 public object Operator(Op op, params object[] args)
 {
     if (binaryOps.ContainsKey(op))
         return binaryOps[op]((bool)args[0], (bool)args[1]);
     if (op == Op.Not)
         return !(bool)args[0];
     throw new NotImplementedException();
 }
开发者ID:ricksladkey,项目名称:Dirichlet,代码行数:8,代码来源:BooleanOperatorMap.cs

示例7: ActionCopyMoveRename

 public ActionCopyMoveRename(Op operation, FileInfo from, FileInfo to, ProcessedEpisode ep)
 {
     this.PercentDone = 0;
     this.Episode = ep;
     this.Operation = operation;
     this.From = from;
     this.To = to;
 }
开发者ID:madams74,项目名称:tvrename,代码行数:8,代码来源:ActionCopyMoveRename.cs

示例8: IsEquivalent

 /// <summary>
 /// Two CostantBaseOps are equivalent if they are of the same 
 /// derived type and have the same type and value. 
 /// </summary>
 /// <param name="other">the other Op</param>
 /// <returns>true, if these are equivalent (not a strict equality test)</returns>
 internal override bool IsEquivalent(Op other)
 {
     var otherConstant = other as ConstantBaseOp;
     return
         otherConstant != null &&
         OpType == other.OpType &&
         otherConstant.Type.EdmEquals(Type) &&
         ((otherConstant.Value == null && Value == null) || otherConstant.Value.Equals(Value));
 }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:15,代码来源:ConstantBaseOp.cs

示例9: Emit

 internal void Emit(Op op, Label label)
 {
     if (!label.IsEmpty())
     {
         fixups.Add(ops.Count);
         Emit(op, label.GetIndex());
     }
     else
         Emit(op, 0);
 }
开发者ID:rizwan3d,项目名称:elalang,代码行数:10,代码来源:CodeWriter.cs

示例10: Compile

		private bool ignore;	// ignore case

		private void Compile (string pattern)
		{
			if (pattern == null || pattern.IndexOfAny (InvalidChars) >= 0)
				throw new ArgumentException ("Invalid search pattern.");

			if (pattern == "*") {	// common case
				ops = new Op (OpCode.True);
				return;
			}

			ops = null;

			int ptr = 0;
			Op last_op = null;
			while (ptr < pattern.Length) {
				Op op;
			
				switch (pattern [ptr]) {
				case '?':
					op = new Op (OpCode.AnyChar);
					++ ptr;
					break;

				case '*':
					op = new Op (OpCode.AnyString);
					++ ptr;
					break;
					
				default:
					op = new Op (OpCode.ExactString);
					int end = pattern.IndexOfAny (WildcardChars, ptr);
					if (end < 0)
						end = pattern.Length;

					op.Argument = pattern.Substring (ptr, end - ptr);
					if (ignore)
						op.Argument = op.Argument.ToLowerInvariant ();

					ptr = end;
					break;
				}

				if (last_op == null)
					ops = op;
				else
					last_op.Next = op;

				last_op = op;
			}

			if (last_op == null)
				ops = new Op (OpCode.End);
			else
				last_op.Next = new Op (OpCode.End);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:57,代码来源:SearchPattern.cs

示例11: Operator

 static Operator()
 {
     Op[] opArray = new Op[9];
     opArray[3] = Op.EQ;
     opArray[4] = Op.NE;
     opArray[5] = Op.GT;
     opArray[6] = Op.GE;
     opArray[7] = Op.LT;
     opArray[8] = Op.LE;
     invertOp = opArray;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:Operator.cs

示例12: Expression

        /// <summary>
        
        /// </summary>
        
        
        
        public Expression(string attrbuteName, Op op, string attrbuteValue)
        {
            if (op == Op.Exists || op == Op.NotExists)
                throw new ArgumentException("op");

            if (String.IsNullOrEmpty(attrbuteName))
                throw new ArgumentException("attrbuteName");

            _op = op;
            _attributeName = attrbuteName;
            _attributeValue = attrbuteValue;
        }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:18,代码来源:Expression.cs

示例13: Binary

 public Binary(Op op, string symbol = "")
 {
     _op = op;
     Left = new Lambda();
     Right = new Lambda();
     if (symbol == "") {
         StringBuilder sb = new StringBuilder();
         sb.Append('[').Append(_opCount.ToString()).Append(']');
         _symbol = sb.ToString();
         _opCount++;
     }
     else {
         _symbol = symbol;
     }
 }
开发者ID:zearen-wover,项目名称:Funct,代码行数:15,代码来源:Funct.cs

示例14: IsTypeTransitive

 private static bool IsTypeTransitive(Op op)
 {
     switch (op)
     {
         case Op.Add:
         case Op.Subtract:
         case Op.Multiply:
         case Op.Remainder:
         case Op.Divide:
         case Op.AndAnd:
         case Op.OrOr:
         case Op.And:
         case Op.Or:
         case Op.ExclusiveOr:
         case Op.LeftShift:
         case Op.RightShift:
             return true;
     }
     return false;
 }
开发者ID:ricksladkey,项目名称:Dirichlet,代码行数:20,代码来源:OperatorHelper.cs

示例15: AddArg

        private void AddArg(Op op, ICollection<Node> argList)
        {
            if (TokType == TokenType.Identifer)
            {

                if (_reg16.ContainsKey(Keyword))
                {
                    argList.Add(_reg16[Keyword]);
                    NextToken();
                }
                else if (_reg8.ContainsKey(Keyword))
                {
                    argList.Add(_reg8[Keyword]);
                    NextToken();
                }
                else if (_specReg.ContainsKey(Keyword))
                {
                    argList.Add(_specReg[Keyword]);
                    NextToken();
                }
                else if (argList.Count == 0)
                {
                    if (op == Op.Jr && _jrCond.ContainsKey(Keyword))
                    {
                        argList.Add(_jrCond[Keyword]);
                        NextToken();
                    }
                    else if ((op == Op.Jp || op == Op.Ret || op == Op.Call) && _cond.ContainsKey(Keyword))
                    {
                        argList.Add(_cond[Keyword]);
                        NextToken();
                    }
                    else
                        argList.Add(Expression());
                }
                else
                    argList.Add(Expression());
            }
            else
                argList.Add(Expression());
        }
开发者ID:demyanenko-d,项目名称:z80asm,代码行数:41,代码来源:Z80Parser.cs


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