本文整理汇总了C#中Operator类的典型用法代码示例。如果您正苦于以下问题:C# Operator类的具体用法?C# Operator怎么用?C# Operator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Operator类属于命名空间,在下文中一共展示了Operator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Evaluate
public static Boolean Evaluate(Object state, ref Boolean error, Operator @operator, String text)
{
Combat.Character character = state as Combat.Character;
if (character == null)
{
error = true;
return false;
}
String authorname = character.BasePlayer.Profile.Author;
if (authorname == null)
{
error = true;
return false;
}
Boolean result = String.Equals(authorname, text, StringComparison.OrdinalIgnoreCase);
switch (@operator)
{
case Operator.Equals:
return result;
case Operator.NotEquals:
return !result;
default:
error = true;
return false;
}
}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:31,代码来源:AuthorName.cs
示例2: Binary
public Binary(SourceSpan span, Operator op, Expression left, Expression right)
: base(span)
{
_op = op;
_left = left;
_right = right;
}
开发者ID:whoisjake,项目名称:Infix,代码行数:7,代码来源:Binary.cs
示例3: UnsafeAccessExpression
internal UnsafeAccessExpression(CsTokenList tokens, Operator operatorType, Expression value)
: base(ExpressionType.UnsafeAccess, tokens)
{
this.operatorType = operatorType;
this.value = value;
base.AddExpression(value);
}
开发者ID:katerina-marchenkova,项目名称:my,代码行数:7,代码来源:UnsafeAccessExpression.cs
示例4: SimpleSelectNode
public SimpleSelectNode(IQueryPlanNode child, ObjectName leftVar, Operator op, Expression rightExpression)
: base(child)
{
this.leftVar = leftVar;
this.op = op;
this.rightExpression = rightExpression;
}
开发者ID:kaktusan,项目名称:plsqlparser,代码行数:7,代码来源:SimpleSelectNode.cs
示例5: GetName
public static string GetName(Operator type)
{
string result = String.Empty;
switch (type)
{
case Operator.Equal:
result = "==";
break;
case Operator.GreaterThan:
result = ">";
break;
case Operator.GreaterThanEqual:
result = ">=";
break;
case Operator.LessThan:
result = "<";
break;
case Operator.LessThanEqual:
result = "<=";
break;
case Operator.NotEqual:
result = "!=";
break;
}
return result;
}
开发者ID:g992com,项目名称:esb,代码行数:28,代码来源:Operator.cs
示例6: Calculation
private Calculation(Column column, Guid id, double operand, Operator @operator)
{
_column = column;
Id = id;
Operand = operand;
Operator = @operator;
}
开发者ID:xwipeoutx,项目名称:ddd-eventsource-demo,代码行数:7,代码来源:Calculation.cs
示例7: cmpQueryQueryE
/*cmpXslt:*/
static bool cmpQueryQueryE(Operator.Op op, object val1, object val2) {
Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE);
bool isEQ = (op == Operator.Op.EQ);
NodeSet n1 = new NodeSet(val1);
NodeSet n2 = new NodeSet(val2);
while (true) {
if (! n1.MoveNext()) {
return false;
}
if (! n2.MoveNext()) {
return false;
}
string str1 = n1.Value;
do {
if ((str1 == n2.Value) == isEQ) {
return true;
}
}while (n2.MoveNext());
n2.Reset();
}
}
开发者ID:uQr,项目名称:referencesource,代码行数:26,代码来源:LogicalExpr.cs
示例8: InsertBinaryOperationMethod
private static void InsertBinaryOperationMethod(Core core, CodeBlockNode root, Operator op, PrimitiveType r, PrimitiveType op1, PrimitiveType op2, int retRank = 0, int op1rank = 0, int op2rank = 0)
{
FunctionDefinitionNode funcDefNode = new FunctionDefinitionNode();
funcDefNode.access = CompilerDefinitions.AccessModifier.kPublic;
funcDefNode.IsAssocOperator = true;
funcDefNode.IsBuiltIn = true;
funcDefNode.Name = Op.GetOpFunction(op);
funcDefNode.ReturnType = new Type() { Name = core.TypeSystem.GetType((int)r), UID = (int)r, rank = retRank };
ArgumentSignatureNode args = new ArgumentSignatureNode();
args.AddArgument(new VarDeclNode()
{
Access = CompilerDefinitions.AccessModifier.kPublic,
NameNode = AstFactory.BuildIdentifier(DSASM.Constants.kLHS),
ArgumentType = new Type { Name = core.TypeSystem.GetType((int)op1), UID = (int)op1, rank = op1rank }
});
args.AddArgument(new VarDeclNode()
{
Access = CompilerDefinitions.AccessModifier.kPublic,
NameNode = AstFactory.BuildIdentifier(DSASM.Constants.kRHS),
ArgumentType = new Type { Name = core.TypeSystem.GetType((int)op2), UID = (int)op2, rank = op2rank }
});
funcDefNode.Signature = args;
CodeBlockNode body = new CodeBlockNode();
var lhs = AstFactory.BuildIdentifier(DSASM.Constants.kLHS);
var rhs = AstFactory.BuildIdentifier(DSASM.Constants.kRHS);
var binaryExpr = AstFactory.BuildBinaryExpression(lhs, rhs, op);
body.Body.Add(AstFactory.BuildReturnStatement(binaryExpr));
funcDefNode.FunctionBody = body;
root.Body.Add(funcDefNode);
}
开发者ID:nmeek,项目名称:Dynamo,代码行数:33,代码来源:CoreUtils.cs
示例9: ProcessOperator
public void ProcessOperator(Operator op)
{
if (ProcessOperatorObject != null)
ProcessOperatorObject(op);
foreach (var obj in op.Children)
obj.AcceptVisitor(this);
}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:7,代码来源:BasicDiscriminatorProcessor.cs
示例10: BuildSelectSqlFor
public string BuildSelectSqlFor(string tableName, string[] fields,
string[] filterFields, Operator[] filterOperators, string[] filterValues,
string[] orders, int limitResultSet)
{
string sql = "select ";
if (limitResultSet > 0)
sql += "top " + limitResultSet + " ";
if (ArrayHelper.IsNull(fields))
sql += "*";
else
sql += string.Join(", ", fields);
sql += " from " + tableName + " ";
if (!ArrayHelper.IsNull(filterFields))
{
sql += "where ";
for (int i = 0; i < filterFields.Length; i++)
{
if (i > 0) sql += " and ";
sql += filterFields[i] + " " + OperatorString(filterOperators[i], filterValues[i]);
}
}
if (!ArrayHelper.IsNull(orders))
{
sql += " order by ";
sql += string.Join(", ", orders);
}
return sql;
}
开发者ID:noseii,项目名称:powerscada2011,代码行数:32,代码来源:SqliteHelper.cs
示例11: QueryExpression
internal QueryExpression(string FieldName, Operator Operator, Guid Value)
{
this.Type = ExpressionType.String;
this.FieldName = FieldName;
this.Operator = Operator;
this.Value = Value.ToString();
}
开发者ID:ssickles,项目名称:archive,代码行数:7,代码来源:QueryExpression.cs
示例12: Delete
public Delete(string table, Operator where, bool allowMultiple)
{
Table.Name = table;
AllowMultiple = allowMultiple;
Where = where;
Filter = FilterType.Where;
}
开发者ID:mikeobrien,项目名称:Gribble,代码行数:7,代码来源:Delete.cs
示例13: ExpressionQuery
public static IMongoQuery ExpressionQuery(string name, Operator optor, BsonValue value)
{
switch (optor)
{
case Operator.EQ:
return M.Query.EQ(name, value);
case Operator.GT:
return M.Query.GT(name, value);
case Operator.GTE:
return M.Query.GTE(name, value);
case Operator.ISNULL:
return M.Query.EQ(name, null);
case Operator.LT:
return M.Query.LT(name, value);
case Operator.LTE:
return M.Query.LTE(name, value);
case Operator.NOTNULL:
return M.Query.NE(name, null);
default:
throw new ArgumentException(String.Format("Invalid operator {0} on token parameter {1}", optor.ToString(), name));
}
}
开发者ID:raysearchlabs,项目名称:spark,代码行数:29,代码来源:CriteriaMongoExtensions.cs
示例14: ExecuteLastOperator
private void ExecuteLastOperator(Operator newOperator)
{
decimal currentValue = Convert.ToDecimal(textBoxDisplay.Text);
decimal newValue = currentValue;
if (numberHitSinceLastOperator)
{
switch (lastOperator)
{
case Operator.Plus:
newValue = valueSoFar + currentValue;
break;
case Operator.Minus:
newValue = valueSoFar - currentValue;
break;
case Operator.Times:
newValue = valueSoFar * currentValue;
break;
case Operator.Divide:
if (currentValue == 0)
newValue = 0;
else
newValue = valueSoFar / currentValue;
break;
case Operator.Equals:
newValue = currentValue;
break;
}
}
valueSoFar = newValue;
lastOperator = newOperator;
numberHitSinceLastOperator = false;
textBoxDisplay.Text = valueSoFar.ToString();
}
开发者ID:ngbrown,项目名称:WPFinAction,代码行数:35,代码来源:CalculatorWindow.xaml.cs
示例15: Connect
public void Connect(Operator outOp, IOOutlet output, Operator inOp, IOOutlet input, bool serialize = true)
{
Connections.Add(new IOConnection() { From=outOp, Output=output, To=inOp, Input=input });
if (serialize) {
TemplateSerializer.Serialize(this);
}
}
开发者ID:BrettRToomey,项目名称:forge,代码行数:7,代码来源:Template.cs
示例16: Evaluate
public static Boolean Evaluate(Object state, ref Boolean error, Operator @operator, xnaMugen.StateType statetype)
{
Combat.Character character = state as Combat.Character;
if (character == null)
{
error = true;
return false;
}
Combat.Player opponent = character.GetOpponent();
if (opponent == null)
{
error = true;
return false;
}
if (statetype == xnaMugen.StateType.Unchanged || statetype == xnaMugen.StateType.None)
{
error = true;
return false;
}
switch (@operator)
{
case Operator.Equals:
return statetype == opponent.StateType;
case Operator.NotEquals:
return statetype != opponent.StateType;
default:
error = true;
return false;
}
}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:35,代码来源:P2StateType.cs
示例17: CreateFilter
private static IMongoQuery CreateFilter(ModelInfo.SearchParamDefinition parameter, Operator op, String modifier, Expression operand)
{
if (op == Operator.CHAIN)
{
throw new NotSupportedException("Chain operators should be handled in MongoSearcher.");
}
else // There's only one operand.
{
var valueOperand = (ValueExpression)operand;
switch (parameter.Type)
{
case Conformance.SearchParamType.Composite:
return CompositeQuery(parameter, op, modifier, valueOperand);
case Conformance.SearchParamType.Date:
return DateQuery(parameter.Name, op, modifier, valueOperand);
case Conformance.SearchParamType.Number:
return NumberQuery(parameter.Name, op, valueOperand);
case Conformance.SearchParamType.Quantity:
return QuantityQuery(parameter.Name, op, modifier, valueOperand);
case Conformance.SearchParamType.Reference:
//Chain is handled in MongoSearcher, so here we have the result of a closed criterium: IN [ list of id's ]
return StringQuery(parameter.Name, op, modifier, valueOperand);
case Conformance.SearchParamType.String:
return StringQuery(parameter.Name, op, modifier, valueOperand);
case Conformance.SearchParamType.Token:
return TokenQuery(parameter.Name, op, modifier, valueOperand);
default:
//return M.Query.Null;
throw new NotSupportedException("Only SearchParamType.Number or String is supported.");
}
}
}
开发者ID:TonyAbell,项目名称:spark,代码行数:32,代码来源:CriteriaMongoExtensions.cs
示例18: PerformOperation
public override Object PerformOperation(Executer exec, Operator op, Object otherTerm)
{
if (op == null)
return this;
this.CheckOperation(op);
string sReturn = "";
string sThis = (string)this.GetUnboxed(exec);
string sOther = otherTerm.GetUnboxed(exec).ToString();
switch (op.InternalTokens)
{
case "+":
sReturn = sThis + sOther;
break;
case "-":
sReturn = sThis.Replace(sOther, "");
break;
case "*":
for (int i = Convert.ToInt32(sOther)-1; i>=0; i--)
sReturn+=sThis;
break;
}
//this.m_value = sReturn;
//return this;
return Types.Object.CreateType(sReturn);
}
开发者ID:timdetering,项目名称:Endogine,代码行数:28,代码来源:String.cs
示例19: test1
// tests building and pretty-printing
static void test1()
{
Template t = new Template();
t.Add("a", ClassType.mark.PLUS);
t.Add("b", ClassType.mark.MINUS);
t.Add("c", ClassType.mark.HASH);
Template t2 = new Template();
t2.Add("a", ClassType.mark.PLUS);
t2.Add("b", ClassType.mark.MINUS);
t2.Add("c", ClassType.mark.MINUS);
Scheme s = new Scheme();
s.Add(t);
s.Add(t2);
Scheme s2 = new Scheme();
Offering o = new Offering(1, 1);
o.addInputScheme(1, s);
o.addOutputScheme(1, s2);
o.addFeedbackInputScheme(1, Scheme.SchemeAsAny());
o.addFeedbackOutputScheme(1, Scheme.SchemeAsAny());
Operator op = new Operator("SELECT", 1, 1);
op.AddOffering(o);
op.AddOffering(o);
Console.WriteLine(op.ToString());
Console.ReadLine();
}
开发者ID:bdombrow,项目名称:CS-510-NiagaraST-Last-Known-Good,代码行数:32,代码来源:Program.cs
示例20: HistoryReadModelTests
public HistoryReadModelTests()
{
_model = new HistoryReadModel();
_user1 = new Operator { Name = "Andy Dote" };
_user2 = new Operator { Name = "John Wick" };
}
开发者ID:Pondidum,项目名称:Magistrate,代码行数:7,代码来源:HistoryReadModelTests.cs
注:本文中的Operator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论