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


C# UnaryOperator.ToString方法代码示例

本文整理汇总了C#中UnaryOperator.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# UnaryOperator.ToString方法的具体用法?C# UnaryOperator.ToString怎么用?C# UnaryOperator.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnaryOperator的用法示例。


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

示例1: 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

示例2: 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

示例3: ReplaceRootOperator

        public void ReplaceRootOperator()
        {
            CriteriaOperator unaryOperator = new UnaryOperator(UnaryOperatorType.IsNull, "prop2");

            var binaryOperatorExtractor = new CriteriaOperatorExtractor();
            var replaceOperator = new BinaryOperator("pr", 1);
            binaryOperatorExtractor.Replace(ref unaryOperator, unaryOperator.ToString(), replaceOperator);

            Assert.AreEqual(unaryOperator, replaceOperator);
        }
开发者ID:aries544,项目名称:eXpand,代码行数:10,代码来源:CriteriaOperatorExtractorFixture.cs

示例4: RemoveRootOperator

        public void RemoveRootOperator()
        {
            CriteriaOperator unaryOperator = new UnaryOperator(UnaryOperatorType.IsNull, "prop2");

            var binaryOperatorExtractor = new CriteriaOperatorExtractor();
            binaryOperatorExtractor.Remove(ref unaryOperator, unaryOperator.ToString());

            Assert.IsNull(unaryOperator);
        }
开发者ID:aries544,项目名称:eXpand,代码行数:9,代码来源:CriteriaOperatorExtractorFixture.cs

示例5: 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, ProtoCore.AST.Node root, UnaryOperator op, PrimitiveType r, PrimitiveType operand)
        {
            ProtoCore.AST.AssociativeAST.FunctionDefinitionNode funcDefNode = new ProtoCore.AST.AssociativeAST.FunctionDefinitionNode();
            funcDefNode.access = ProtoCore.DSASM.AccessSpecifier.kPublic;
            funcDefNode.IsAssocOperator = true;
            funcDefNode.IsBuiltIn = true;
            funcDefNode.Name = ProtoCore.DSASM.Constants.kInternalNamePrefix + op.ToString();
            funcDefNode.ReturnType = new ProtoCore.Type() { Name = core.TypeSystem.GetType((int)r), UID = (int)r };
            ProtoCore.AST.AssociativeAST.ArgumentSignatureNode args = new ProtoCore.AST.AssociativeAST.ArgumentSignatureNode();
            args.AddArgument(new ProtoCore.AST.AssociativeAST.VarDeclNode()
            {
            memregion = ProtoCore.DSASM.MemoryRegion.kMemStack,
            access = ProtoCore.DSASM.AccessSpecifier.kPublic,
            NameNode = BuildAssocIdentifier(core, "%param"),
            ArgumentType = new ProtoCore.Type { Name = core.TypeSystem.GetType((int)operand), UID = (int)operand }
            });
            funcDefNode.Singnature = args;

            ProtoCore.AST.AssociativeAST.CodeBlockNode body = new ProtoCore.AST.AssociativeAST.CodeBlockNode();
            ProtoCore.AST.AssociativeAST.IdentifierNode _return = BuildAssocIdentifier(core, ProtoCore.DSDefinitions.Kw.kw_return, ProtoCore.PrimitiveType.kTypeReturn);
            ProtoCore.AST.AssociativeAST.IdentifierNode param = BuildAssocIdentifier(core, "%param");
            body.Body.Add(new ProtoCore.AST.AssociativeAST.BinaryExpressionNode() { LeftNode = _return, Optr = ProtoCore.DSASM.Operator.assign, RightNode = new ProtoCore.AST.AssociativeAST.UnaryExpressionNode() { Expression = param, Operator = op } });
            funcDefNode.FunctionBody = body;
            (root as ProtoCore.AST.AssociativeAST.CodeBlockNode).Body.Add(funcDefNode);
        }
开发者ID:Benglin,项目名称:designscript,代码行数:27,代码来源:CoreUtils.cs

示例6: GenerateUnaryOperatorMethodCallNode

        private ProtoCore.AST.AssociativeAST.AssociativeNode GenerateUnaryOperatorMethodCallNode(UnaryOperator op, ProtoCore.AST.AssociativeAST.AssociativeNode operand)
        {
            ProtoCore.AST.AssociativeAST.FunctionCallNode funCallNode = new ProtoCore.AST.AssociativeAST.FunctionCallNode();
            ProtoCore.AST.AssociativeAST.IdentifierNode funcName = new ProtoCore.AST.AssociativeAST.IdentifierNode { Value = ProtoCore.DSASM.Constants.kInternalNamePrefix + op.ToString(), Name = ProtoCore.DSASM.Constants.kInternalNamePrefix + op.ToString() };
            funCallNode.Function = funcName;
            funCallNode.Name = ProtoCore.DSASM.Constants.kInternalNamePrefix + op.ToString();
            funCallNode.FormalArguments.Add(operand);

            NodeUtils.CopyNodeLocation(funCallNode, operand);
            return funCallNode;
        }
开发者ID:Benglin,项目名称:designscript,代码行数:11,代码来源:Parser.cs

示例7: GetUnaryOpFunction

 /// <summary>
 /// Return the internal function name for unary operator
 /// </summary>
 /// <param name="op"></param>
 /// <returns></returns>
 public static string GetUnaryOpFunction(UnaryOperator op)
 {
     return Constants.kInternalNamePrefix + op.ToString();
 }
开发者ID:dimven,项目名称:Dynamo,代码行数:9,代码来源:DSasmDefs.cs

示例8: ToString

		static string ToString (UnaryOperator op)
		{
			switch (op) {
			case UnaryOperator.BitwiseComplement: return "~";
			case UnaryOperator.Not: return "!";
			}
			throw new ArgumentException (op.ToString (), "op");
		}
开发者ID:transformersprimeabcxyz,项目名称:cecil-old,代码行数:8,代码来源:ExpressionPrinter.cs


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