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

C# Operators类代码示例

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

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



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

示例1: Condition

 public Condition(bool not, string key, Operators opt,  params object[] values)
 {
     Key = key;
     Operate = opt;
     Values = values;
     Not = not;
 }
开发者ID:Behzadkhosravifar,项目名称:AdoManager,代码行数:7,代码来源:Condition.cs


示例2: TransformSet

 internal override MSAst.Expression TransformSet(AstGenerator ag, SourceSpan span, MSAst.Expression right, Operators op) {
     if (op == Operators.None) {
         return ag.AddDebugInfoAndVoid(
             Binders.Set(
                 ag.BinderState,
                 typeof(object),
                 SymbolTable.IdToString(_name),
                 ag.Transform(_target),
                 right
             ),
             span
         );
     } else {
         MSAst.ParameterExpression temp = ag.GetTemporary("inplace");
         return ag.AddDebugInfo(
             Ast.Block(
                 Ast.Assign(temp, ag.Transform(_target)),
                 SetMemberOperator(ag, right, op, temp),
                 Ast.Empty()
             ),
             Span.Start,
             span.End
         );
     }
 }
开发者ID:octavioh,项目名称:ironruby,代码行数:25,代码来源:MemberExpression.cs


示例3: Rule

 public Rule(Operators operand, string to, string operandOne, string operandTwo)
 {
     this.Operation = operand;
     this.To = to;
     this.First = operandOne;
     this.Second = operandTwo;
 }
开发者ID:KoalaBear84,项目名称:AdventOfCode2015-1,代码行数:7,代码来源:Program.cs


示例4: TransformSet

        internal override MSAst.Expression TransformSet(AstGenerator ag, SourceSpan span, MSAst.Expression right, Operators op) {
            MSAst.Expression variable = _reference.Variable;
            MSAst.Expression assignment;

            Type vt = variable != null ? variable.Type : typeof(object);

            if (op != Operators.None) {
                right = Binders.Operation(
                    ag.BinderState,
                    vt,
                    StandardOperators.FromOperator(op),
                    Transform(ag, vt),
                    right
                );
            }

            if (variable != null) {
                assignment = AstUtils.Assign(variable, AstGenerator.ConvertIfNeeded(right, variable.Type));
            } else {
                assignment = AstUtils.Assign(_name, right);
            }

            SourceSpan aspan = span.IsValid ? new SourceSpan(Span.Start, span.End) : SourceSpan.None;
            return ag.AddDebugInfoAndVoid(assignment, aspan);
        }
开发者ID:octavioh,项目名称:ironruby,代码行数:25,代码来源:NameExpression.cs


示例5: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ViewState.Clear();
                this.result = 0;
                ViewState.Add("result", this.result);
                this.currentOperator = Operators.Plus;
                ViewState.Add("operator", this.currentOperator);
                ViewState.Add("currentNumber", string.Empty);
            }
            else
            {
                this.result = (decimal)ViewState["result"];
                if (ViewState["operator"] != null)
                {
                    this.currentOperator = (Operators)ViewState["operator"];
                }

                if (ViewState["currentNumber"] != null)
                {
                    this.currentNumber = (string)ViewState["currentNumber"];
                }

            }
        }
开发者ID:PetarPenev,项目名称:Telerik,代码行数:26,代码来源:Calculator.aspx.cs


示例6: Expression

 public Expression(Expression ex, Expression e2, Operators op)
 {
     Ex1 = ex;
     Ex2 = e2;
     Oper = op;
     IsValue = false;
 }
开发者ID:henkeholme,项目名称:ExpressionExercise,代码行数:7,代码来源:Expression.cs


示例7: FloatCondition

 public FloatCondition(string conditionVariable, Operators conditionOperator, float baseValue, bool absolute = false)
 {
     this.conditionVariable = conditionVariable;
       this.conditionOperator = conditionOperator;
       this.baseValue = baseValue;
       this.absolute = absolute;
 }
开发者ID:BrunoRomes,项目名称:UnityTests,代码行数:7,代码来源:FloatCondition.cs


示例8: QuerySpecific

        private static async void QuerySpecific(string field, object value, Operators op)
        {
            Console.WriteLine("Finding all the entries where {0} equals {1}...", field, value);
            var collection = database.GetCollection<BsonDocument>(collectionName);
            var builder = Builders<BsonDocument>.Filter;
            FilterDefinition<BsonDocument> filter = null;
            switch (op)
            {
                case Operators.Equals:
                default:
                    filter = builder.Eq(field, value);
                    break;
                case Operators.LessThan:
                    filter = builder.Lt(field, value);
                    break;
                case Operators.GreaterThan:
                    filter = builder.Gt(field, value);
                    break;
                case Operators.LessThanEqual:
                    filter = builder.Lte(field, value);
                    break;
                case Operators.GreaterThanEqual:
                    filter = builder.Gte(field, value);
                    break;
            }

            var result = await collection.Find(filter).ToListAsync();
            Console.WriteLine("There are {0} entries.", result.Count);
        }
开发者ID:rperneel,项目名称:mongoSandbox,代码行数:29,代码来源:Program.cs


示例9: DoOperation

 public void DoOperation(Operators @operator, int operand)
 {
     Executor command = new Executor(_calculator, @operator, operand);
     command.Execute();
     _index = _entries.Count;
     _index++;
     _entries.Add(command);
 }
开发者ID:baudi,项目名称:sandbox,代码行数:8,代码来源:ConsoleMenu.cs


示例10: TransformSet

        internal override MSAst.Expression TransformSet(AstGenerator ag, SourceSpan span, MSAst.Expression right, Operators op) {
            if (Items.Length == 0) {
                ag.AddError("can't assign to ()", Span);
                return null;
            }

            return base.TransformSet(ag, span, right, op);
        }
开发者ID:octavioh,项目名称:ironruby,代码行数:8,代码来源:TupleExpression.cs


示例11: FromOperator

 public static string FromOperator(Operators op) {
     switch(op) {
         case Operators.Equals: return "Equal";
         case Operators.NotEquals: return "NotEqual";
         default:
             return op.ToString();
     }
 }
开发者ID:joshholmes,项目名称:ironruby,代码行数:8,代码来源:Operators.cs


示例12: GetOpposite

 private Operators GetOpposite(Operators @operator)
 {
     switch (@operator)
     {
         case Operators.Add: return Operators.Rest;
         case Operators.Rest: return Operators.Add;
         case Operators.Mult: return Operators.Div;
         default: return Operators.Mult;
     }
 }
开发者ID:baudi,项目名称:sandbox,代码行数:10,代码来源:Executor.cs


示例13: GetSymbol

 private char GetSymbol(Operators @operator)
 {
     switch (@operator)
     {
         case Operators.Add: return '+';
         case Operators.Rest: return '-';
         case Operators.Mult: return '*';
         default: return '/';
     }
 }
开发者ID:baudi,项目名称:sandbox,代码行数:10,代码来源:Calculator.cs


示例14: BuildConditionFromXML

 private void BuildConditionFromXML(XmlElement xmlElement)
 {
     try
     {
         this.FieldName = xmlElement.GetAttribute("Field");
         this.comparisionOperator = (Operators)Enum.Parse(typeof(Operators), xmlElement.GetAttribute("Operator"));
         this.strValue = xmlElement.GetAttribute("Value");
         this.comparisionType = (ConditionComparisionType)Enum.Parse(typeof(ConditionComparisionType), xmlElement.GetAttribute("ComparisionType"));
     }
     catch { }
 }
开发者ID:karayakar,项目名称:SharePoint,代码行数:11,代码来源:Condition.cs


示例15: FilterExpression

        internal FilterExpression(object left, object right, Operators op)
        {
            Left = left as FilterExpression;
            Right = right as FilterExpression;
            LeftColumn = left as Column;
            RightColumn = right as Column;
            Value = Right == null && ReferenceEquals(RightColumn, null) ? right : null;
            Operator = op;

            if (AndOr && (Left == null || Right == null)) // should never happen but just in case
                throw new Exception("All/Or expressions only act on two other FilterExpressions");
        }
开发者ID:vetraskr,项目名称:Pagan,代码行数:12,代码来源:FilterExpression.cs


示例16: IsAssigmentOperator

 public static bool IsAssigmentOperator(Operators Operator)
 {
     switch (Operator)
     {
         case Operators.AssignmentAddition: 
         case Operators.AssignmentSubtraction: 
         case Operators.AssignmentMultiplication: 
         case Operators.AssignmentDivision: 
         case Operators.Assignment: return true;          
     }
     return false;
 }
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:12,代码来源:TreeSubsidiary.cs


示例17: JointConstraint

    public JointConstraint( KinectWrapper.Joints joint_a,
							KinectWrapper.Joints joint_b,
							Relations relation,
							Operators operation,
							Vector3 val )
    {
        this.joint_a = joint_a;
        this.joint_b = joint_b;
        this.relation = relation;
        this.operation = operation;
        this.val = val;
    }
开发者ID:vladotrocol,项目名称:van-dyke,代码行数:12,代码来源:JointConstraint.cs


示例18: JointConstraint

    public JointConstraint( KinectSkeleton ks,
							KinectSkeleton.Joints joint_a,
							KinectSkeleton.Joints joint_b,
							Relations relation,
							Operators operation,
							Vector3 val )
    {
        this.ks = ks;
        this.joint_a = joint_a;
        this.joint_b = joint_b;
        this.relation = relation;
        this.operation = operation;
        this.val = val;
    }
开发者ID:brgmnn,项目名称:van-dyke,代码行数:14,代码来源:JointConstraint.cs


示例19: _GetNumberOfChildrenFor

 static int _GetNumberOfChildrenFor(Operators symbol)
 {
     switch(symbol)
     {
         case Operators.Multiply:
         case Operators.Divide:
         case Operators.Plus:
         case Operators.Minus:
             return 2;
         case Operators.Sqrt:
             return 1;
         default:
             return 0;
     }
 }
开发者ID:jcbozonier,项目名称:GeneticProgrammingWithSimpleMath,代码行数:15,代码来源:GenomeConverter.cs


示例20: DoOperation

 public void DoOperation(Operators @operator, int operand)
 {
     switch (@operator)
     {
         case Operators.Add: _total += operand;
             break;
         case Operators.Rest: _total -= operand;
             break;
         case Operators.Mult: _total *= operand;
             break;
         case Operators.Div: _total /= operand;
             break;
     }
     Console.WriteLine("Total: {0,3} \t{1} {2}",
         _total, GetSymbol(@operator), operand);
 }
开发者ID:baudi,项目名称:sandbox,代码行数:16,代码来源:Calculator.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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