本文整理汇总了C#中UnaryOperator类的典型用法代码示例。如果您正苦于以下问题:C# UnaryOperator类的具体用法?C# UnaryOperator怎么用?C# UnaryOperator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnaryOperator类属于命名空间,在下文中一共展示了UnaryOperator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UnaryFormula
/// <summary>
/// Initializes a new instance of the <see cref="UnaryFormula" /> class.
/// </summary>
/// <param name="operand">The operand of the unary formula.</param>
/// <param name="unaryOperator">The operator of the unary formula.</param>
internal UnaryFormula(Formula operand, UnaryOperator unaryOperator)
{
Requires.NotNull(operand, nameof(operand));
Requires.InRange(unaryOperator, nameof(unaryOperator));
Operand = operand;
Operator = unaryOperator;
}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:13,代码来源:UnaryFormula.cs
示例2: ExtractMethodName
public void ExtractMethodName()
{
var unaryOperator = new UnaryOperator(UnaryOperatorType.IsNull, "");
CriteriaOperatorExtractor binaryOperatorExtractor = GetBinaryOperatorExtractor(unaryOperator);
Assert.AreEqual(unaryOperator, binaryOperatorExtractor.UnaryOperators[0]);
}
开发者ID:cevious,项目名称:eXpand,代码行数:8,代码来源:CriteriaOperatorExtractorFixture.cs
示例3: UnaryExpression
public UnaryExpression(IExpression theExpression, UnaryOperator unaryOperator)
{
if ((object)theExpression == null)
throw new ArgumentNullException(nameof(theExpression));
this.theExpression = theExpression;
this.unaryOperator = unaryOperator;
}
开发者ID:textmetal,项目名称:main,代码行数:8,代码来源:UnaryExpression.cs
示例4: OperatorToString
public static string OperatorToString(UnaryOperator @operator)
{
string operatorString;
if (!PrefixUnaryOperatorMapping.TryGetValue(@operator, out operatorString) &&
!PostUnaryOperatorMapping.TryGetValue(@operator, out operatorString))
throw new ArgumentException("Operator does not exist in the C# language.");
return operatorString;
}
开发者ID:JerreS,项目名称:AbstractCode,代码行数:8,代码来源:CSharpLanguage.cs
示例5: AstUnaryOperator
public AstUnaryOperator(ISourcePosition position, UnaryOperator op, AstExpr operand)
: base(position)
{
if (operand == null)
throw new ArgumentNullException("operand");
_operator = op;
_operand = operand;
}
开发者ID:SealedSun,项目名称:prx,代码行数:9,代码来源:AstUnaryOperator.cs
示例6: Visit
public object Visit(UnaryOperator theOperator)
{
switch (theOperator.OperatorType)
{
case UnaryOperatorType.IsNull: UpdatePropertyName(theOperator.Operand); break;
case UnaryOperatorType.Not: theOperator.Operand.Accept(this); break;
}
return theOperator;
}
开发者ID:Rukhlov,项目名称:DataStudio,代码行数:9,代码来源:EnumCriteriaParser.cs
示例7: VisitUnaryExpression
public override void VisitUnaryExpression(UnaryExpression node)
{
if ((this.methodInvocationsStackCount == 0 && !(node.Operand is ArgumentReferenceExpression)) &&
(node.Operator == UnaryOperator.AddressDereference || node.Operator == UnaryOperator.AddressReference || node.Operator == UnaryOperator.AddressOf))
{
this.IsAddressUnaryOperatorFound = true;
this.FoundUnaryOperator = node.Operator;
}
base.VisitUnaryExpression(node);
}
开发者ID:juancarlosbaezpozos,项目名称:JustDecompileEngine,代码行数:11,代码来源:DetermineNotSupportedVBCodeStep.cs
示例8: UnaryExpression
public UnaryExpression(UnaryOperator @operator, Expression operand, IEnumerable<Instruction> instructions)
:base(instructions)
{
this.Operator = @operator;
this.Operand = operand;
if (operand is UnaryExpression && @operator == UnaryOperator.None)
{
// flatten it
this.Operand = (operand as UnaryExpression).Operand;
this.Operator = (operand as UnaryExpression).Operator;
this.instructions.AddRange((operand as UnaryExpression).instructions);
}
}
开发者ID:juancarlosbaezpozos,项目名称:JustDecompileEngine,代码行数:14,代码来源:UnaryExpression.cs
示例9: convertOperatorToString
private string convertOperatorToString(UnaryOperator operation)
{
string result = "";
switch (operation) {
case UnaryOperator.PLUS: {
result = "+";
break;
}
case UnaryOperator.MINUS: {
result = "-";
break;
}
case UnaryOperator.BINARY_NOT: {
result = "~";
break;
}
}
return result;
}
开发者ID:Edhendil,项目名称:MonoLiteOrm,代码行数:19,代码来源:UnaryOperatorExpression.cs
示例10: InsertUnaryOperationMethod
// The following methods are used to insert methods to the bottom of the AST and convert operator to these method calls
// to support replication on operators
private static void InsertUnaryOperationMethod(Core core, CodeBlockNode root, UnaryOperator op, PrimitiveType r, PrimitiveType operand)
{
FunctionDefinitionNode funcDefNode = new FunctionDefinitionNode();
funcDefNode.Access = CompilerDefinitions.AccessModifier.Public;
funcDefNode.IsAssocOperator = true;
funcDefNode.IsBuiltIn = true;
funcDefNode.Name = Op.GetUnaryOpFunction(op);
funcDefNode.ReturnType = new Type() { Name = core.TypeSystem.GetType((int)r), UID = (int)r };
ArgumentSignatureNode args = new ArgumentSignatureNode();
args.AddArgument(new VarDeclNode()
{
Access = CompilerDefinitions.AccessModifier.Public,
NameNode = AstFactory.BuildIdentifier("%param"),
ArgumentType = new Type { Name = core.TypeSystem.GetType((int)operand), UID = (int)operand }
});
funcDefNode.Signature = args;
CodeBlockNode body = new CodeBlockNode();
IdentifierNode param = AstFactory.BuildIdentifier("%param");
body.Body.Add(AstFactory.BuildReturnStatement(new UnaryExpressionNode() { Expression = param, Operator = op }));
funcDefNode.FunctionBody = body;
root.Body.Add(funcDefNode);
}
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:25,代码来源:CoreUtils.cs
示例11: BuildUnaryExpression
ICodeNode BuildUnaryExpression(UnaryOperator @operator, Expression expression, IEnumerable<Instruction> instructions)
{
return new UnaryExpression(@operator, (Expression)codeTransformer.Visit(expression), instructions);
}
开发者ID:juancarlosbaezpozos,项目名称:JustDecompileEngine,代码行数:4,代码来源:OperatorStep.cs
示例12: Visit
public override Object Visit(UnaryOperator theOperator)
{
return base.Visit(theOperator);
}
开发者ID:derjabkin,项目名称:eXpand,代码行数:4,代码来源:CriteriaToHqlConverter.cs
示例13: ToString
static string ToString (UnaryOperator op)
{
switch (op) {
case UnaryOperator.BitwiseNot:
return "~";
case UnaryOperator.LogicalNot:
return "!";
case UnaryOperator.Negate:
return "-";
case UnaryOperator.PostDecrement:
case UnaryOperator.PreDecrement:
return "--";
case UnaryOperator.PostIncrement:
case UnaryOperator.PreIncrement:
return "++";
default: throw new ArgumentException ();
}
}
开发者ID:transformersprimeabcxyz,项目名称:cecil-old,代码行数:18,代码来源:CSharpWriter.cs
示例14: UnaryOperatorNavigator
/// <summary>Default constructor with nagivated unary operator.</summary>
/// <param name="unaryOperator">Nagivated unary operator.</param>
internal UnaryOperatorNavigator(UnaryOperator unaryOperator)
: base(unaryOperator)
{
}
开发者ID:rafalrosochacki,项目名称:RomanticWeb,代码行数:6,代码来源:UnaryOperatorNavigator.cs
示例15: ReplaceNestedOperator
public void ReplaceNestedOperator()
{
var unaryOperator = new UnaryOperator(UnaryOperatorType.BitwiseNot, "pro");
CriteriaOperator criteriaOperator = new GroupOperator(new BinaryOperator(), unaryOperator);
var binaryOperatorExtractor = new CriteriaOperatorExtractor();
var notOperator = new NotOperator();
binaryOperatorExtractor.Replace(ref criteriaOperator, unaryOperator.ToString(), notOperator);
Assert.AreEqual(((GroupOperator) criteriaOperator).Operands[1], notOperator);
}
开发者ID:aries544,项目名称:eXpand,代码行数:11,代码来源:CriteriaOperatorExtractorFixture.cs
示例16: RemoveNestedOperator
public void RemoveNestedOperator()
{
var unaryOperator = new UnaryOperator(UnaryOperatorType.IsNull, "prop2");
CriteriaOperator groupOperator = new GroupOperator(new BinaryOperator("pro1", 1), unaryOperator);
var binaryOperatorExtractor = new CriteriaOperatorExtractor();
binaryOperatorExtractor.Remove(ref groupOperator, unaryOperator.ToString());
Assert.AreEqual(new BinaryOperator("pro1", 1).ToString(), groupOperator.ToString());
}
开发者ID:aries544,项目名称:eXpand,代码行数:10,代码来源:CriteriaOperatorExtractorFixture.cs
示例17: BuildUnaryExpression
ICodeNode BuildUnaryExpression (UnaryOperator @operator, Expression expression)
{
return new UnaryExpression (@operator, (Expression) Visit (expression));
}
开发者ID:chkn,项目名称:cecil,代码行数:4,代码来源:OperatorStep.cs
示例18: ToString
protected abstract string ToString(UnaryOperator op);
开发者ID:GiGatR00n,项目名称:JustDecompileEngine,代码行数:1,代码来源:BaseImperativeLanguageWriter.cs
示例19: IsPostUnaryOperator
protected bool IsPostUnaryOperator(UnaryOperator op)
{
switch (op)
{
case UnaryOperator.PostIncrement:
case UnaryOperator.PostDecrement:
return true;
default:
return false;
}
}
开发者ID:GiGatR00n,项目名称:JustDecompileEngine,代码行数:11,代码来源:BaseImperativeLanguageWriter.cs
示例20: Visit
public object Visit(UnaryOperator theOperator)
{
if (theOperator.OperatorType == UnaryOperatorType.Not) {
return BooleanCriteriaStateObject.Logical;
}
if(theOperator.OperatorType == UnaryOperatorType.IsNull) return BooleanCriteriaStateObject.Logical;
return BooleanCriteriaStateObject.Value;
}
开发者ID:eolandezhang,项目名称:Diagram,代码行数:8,代码来源:Evaluator.cs
注:本文中的UnaryOperator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论