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

C# MethodInvocationExpression类代码示例

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

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



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

示例1: OnArrayTypeReference

 public override void OnArrayTypeReference(Boo.Lang.Compiler.Ast.ArrayTypeReference node)
 {
     MethodInvocationExpression mie = new MethodInvocationExpression(
             node.LexicalInfo,
             CreateReference(node, "Boo.Lang.Compiler.Ast.ArrayTypeReference"));
     mie.Arguments.Add(Serialize(node.LexicalInfo));
     if (ShouldSerialize(node.IsPointer))
     {
         mie.NamedArguments.Add(
             new ExpressionPair(
                 CreateReference(node, "IsPointer"),
                 Serialize(node.IsPointer)));
     }
     if (ShouldSerialize(node.ElementType))
     {
         mie.NamedArguments.Add(
             new ExpressionPair(
                 CreateReference(node, "ElementType"),
                 Serialize(node.ElementType)));
     }
     if (ShouldSerialize(node.Rank))
     {
         mie.NamedArguments.Add(
             new ExpressionPair(
                 CreateReference(node, "Rank"),
                 Serialize(node.Rank)));
     }
     Push(mie);
 }
开发者ID:BITechnologies,项目名称:boo,代码行数:29,代码来源:CodeSerializer.cs


示例2: ConstructorInitializerStatement

        /// <summary>
        /// Initializes a new instance of the ConstructorInitializerStatement class.
        /// </summary>
        /// <param name="proxy">Proxy object for the statement.</param>
        /// <param name="expression">The expression within this statement.</param>
        internal ConstructorInitializerStatement(CodeUnitProxy proxy, MethodInvocationExpression expression)
            : base(proxy, StatementType.ConstructorInitializer)
        {
            Param.AssertNotNull(proxy, "proxy");
            Param.AssertNotNull(expression, "expression");

            this.expression.Value = expression;
        }
开发者ID:jonthegiant,项目名称:StyleCop,代码行数:13,代码来源:ConstructorInitializerStatement.cs


示例3: ConstructorInitializerStatement

        /// <summary>
        /// Initializes a new instance of the ConstructorInitializerStatement class.
        /// </summary>
        /// <param name="tokens">
        /// The list of tokens that form the statement.
        /// </param>
        /// <param name="expression">
        /// The expression within this statement.
        /// </param>
        internal ConstructorInitializerStatement(CsTokenList tokens, MethodInvocationExpression expression)
            : base(StatementType.ConstructorInitializer, tokens)
        {
            Param.AssertNotNull(tokens, "tokens");
            Param.AssertNotNull(expression, "expression");

            this.expression = expression;
            this.AddExpression(expression);
        }
开发者ID:kopelli,项目名称:Visual-StyleCop,代码行数:18,代码来源:ConstructorInitializerStatement.cs


示例4: AddArgumentReplacements

		/// <summary>
		///     Handles the replacement of the <paramref name="invocation" />'s arguments.
		/// </summary>
		public void AddArgumentReplacements(MethodInvocationExpression invocation)
		{
			var methodBody = invocation.Method.MethodBody;
			var parameters = methodBody.Parameters.ToArray();
			var arguments = invocation.Arguments.ToArray();

			Assert.That(parameters.Length == arguments.Length, "Parameters and arguments don't match up.");

			for (var i = 0; i < parameters.Length; ++i)
			{
				if (arguments[i].RefKind != RefKind.None || !VariableAccessClassifier.Classify(methodBody.Body, parameters[i]).IsWritten())
					AddVariableReplacement(parameters[i], arguments[i].Expression);
			}
		}
开发者ID:cubeme,项目名称:safety-sharp,代码行数:17,代码来源:VariableReplacer.cs


示例5: VisitMethodInvocationExpression

		/// <summary>
		///     Visits an element of type <see cref="MethodInvocationExpression" />.
		/// </summary>
		/// <param name="expression">The <see cref="MethodInvocationExpression" /> instance that should be visited.</param>
		protected internal override BoundNode VisitMethodInvocationExpression(MethodInvocationExpression expression)
		{
			var body = expression.Method.MethodBody.Body;
			var returnStatement = body.Statements[0] as ReturnStatement;

			Requires.That(returnStatement != null,
				"Detected an invalid invocation of method '{0}' declared by '{1}' within the formula: The invoked method does not " +
				"consist of a single return statement only.",
				expression.Method.MethodInfo, expression.Method.MethodInfo.DeclaringType.FullName);

			_variableReplacer.AddArgumentReplacements(expression);

			var replacedBody = (Expression)_variableReplacer.Visit(returnStatement.Expression);
			return Visit(replacedBody);
		}
开发者ID:cubeme,项目名称:safety-sharp,代码行数:19,代码来源:FormulaInliner.cs


示例6: OnArrayLiteralExpression

 public override void OnArrayLiteralExpression(Boo.Lang.Compiler.Ast.ArrayLiteralExpression node)
 {
     MethodInvocationExpression mie = new MethodInvocationExpression(
             node.LexicalInfo,
             CreateReference(node, "Boo.Lang.Compiler.Ast.ArrayLiteralExpression"));
     if (ShouldSerialize(node.Items))
     {
         mie.NamedArguments.Add(
             new ExpressionPair(
                 CreateReference(node, "Items"),
                 SerializeCollection(node, "Boo.Lang.Compiler.Ast.ExpressionCollection", node.Items)));
     }
     if (ShouldSerialize(node.Type))
     {
         mie.NamedArguments.Add(
             new ExpressionPair(
                 CreateReference(node, "Type"),
                 Serialize(node.Type)));
     }
     Push(mie);
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:21,代码来源:CodeSerializer.cs


示例7: OnBlockExpression

		override public void OnBlockExpression(Boo.Lang.Compiler.Ast.BlockExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.BlockExpression"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Parameters))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Parameters"),
						SerializeCollection(node, "Boo.Lang.Compiler.Ast.ParameterDeclarationCollection", node.Parameters)));
			}
			if (ShouldSerialize(node.ReturnType))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "ReturnType"),
						Serialize(node.ReturnType)));
			}
			if (ShouldSerialize(node.Body))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Body"),
						Serialize(node.Body)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:29,代码来源:CodeSerializer.cs


示例8: OnEvent

		override public void OnEvent(Boo.Lang.Compiler.Ast.Event node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.Event"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Attributes"),
						SerializeCollection(node, "Boo.Lang.Compiler.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Add))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Add"),
						Serialize(node.Add)));
			}
			if (ShouldSerialize(node.Remove))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Remove"),
						Serialize(node.Remove)));
			}
			if (ShouldSerialize(node.Raise))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Raise"),
						Serialize(node.Raise)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Type"),
						Serialize(node.Type)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:57,代码来源:CodeSerializer.cs


示例9: OnField

		override public void OnField(Boo.Lang.Compiler.Ast.Field node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.Field"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Attributes"),
						SerializeCollection(node, "Boo.Lang.Compiler.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Type"),
						Serialize(node.Type)));
			}
			if (ShouldSerialize(node.Initializer))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Initializer"),
						Serialize(node.Initializer)));
			}
			if (ShouldSerialize(node.IsVolatile))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "IsVolatile"),
						Serialize(node.IsVolatile)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:50,代码来源:CodeSerializer.cs


示例10: OnImport

		override public void OnImport(Boo.Lang.Compiler.Ast.Import node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.Import"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Expression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Expression"),
						Serialize(node.Expression)));
			}
			if (ShouldSerialize(node.AssemblyReference))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "AssemblyReference"),
						Serialize(node.AssemblyReference)));
			}
			if (ShouldSerialize(node.Alias))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Alias"),
						Serialize(node.Alias)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:29,代码来源:CodeSerializer.cs


示例11: OnStatementTypeMember

		override public void OnStatementTypeMember(Boo.Lang.Compiler.Ast.StatementTypeMember node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.StatementTypeMember"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Attributes"),
						SerializeCollection(node, "Boo.Lang.Compiler.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.Statement))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Statement"),
						Serialize(node.Statement)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:36,代码来源:CodeSerializer.cs


示例12: SerializeSpliceTypeReference

		internal void SerializeSpliceTypeReference(Boo.Lang.Compiler.Ast.SpliceTypeReference node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.SpliceTypeReference"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.IsPointer))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "IsPointer"),
						Serialize(node.IsPointer)));
			}
			if (ShouldSerialize(node.Expression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Expression"),
						Serialize(node.Expression)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:22,代码来源:CodeSerializer.cs


示例13: OnDoubleLiteralExpression

		override public void OnDoubleLiteralExpression(Boo.Lang.Compiler.Ast.DoubleLiteralExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.DoubleLiteralExpression"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Value))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Value"),
						Serialize(node.Value)));
			}
			if (ShouldSerialize(node.IsSingle))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "IsSingle"),
						Serialize(node.IsSingle)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:22,代码来源:CodeSerializer.cs


示例14: OnConditionalExpression

		override public void OnConditionalExpression(Boo.Lang.Compiler.Ast.ConditionalExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.ConditionalExpression"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Condition))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Condition"),
						Serialize(node.Condition)));
			}
			if (ShouldSerialize(node.TrueValue))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "TrueValue"),
						Serialize(node.TrueValue)));
			}
			if (ShouldSerialize(node.FalseValue))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "FalseValue"),
						Serialize(node.FalseValue)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:29,代码来源:CodeSerializer.cs


示例15: OnBinaryExpression

		override public void OnBinaryExpression(Boo.Lang.Compiler.Ast.BinaryExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.BinaryExpression"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Operator))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Operator"),
						Serialize(node.Operator)));
			}
			if (ShouldSerialize(node.Left))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Left"),
						Serialize(node.Left)));
			}
			if (ShouldSerialize(node.Right))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Right"),
						Serialize(node.Right)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:29,代码来源:CodeSerializer.cs


示例16: OnCustomStatement

		override public void OnCustomStatement(Boo.Lang.Compiler.Ast.CustomStatement node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.CustomStatement"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Modifier))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Modifier"),
						Serialize(node.Modifier)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:15,代码来源:CodeSerializer.cs


示例17: OnCustomExpression

		override public void OnCustomExpression(Boo.Lang.Compiler.Ast.CustomExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.CustomExpression"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:8,代码来源:CodeSerializer.cs


示例18: SerializeSpliceMemberReferenceExpression

		internal void SerializeSpliceMemberReferenceExpression(Boo.Lang.Compiler.Ast.SpliceMemberReferenceExpression node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.SpliceMemberReferenceExpression"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Target))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Target"),
						Serialize(node.Target)));
			}
			if (ShouldSerialize(node.NameExpression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "NameExpression"),
						Serialize(node.NameExpression)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:22,代码来源:CodeSerializer.cs


示例19: OnGenericTypeDefinitionReference

		override public void OnGenericTypeDefinitionReference(Boo.Lang.Compiler.Ast.GenericTypeDefinitionReference node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.GenericTypeDefinitionReference"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.IsPointer))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "IsPointer"),
						Serialize(node.IsPointer)));
			}
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.GenericPlaceholders))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "GenericPlaceholders"),
						Serialize(node.GenericPlaceholders)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:29,代码来源:CodeSerializer.cs


示例20: SerializeSpliceParameterDeclaration

		internal void SerializeSpliceParameterDeclaration(Boo.Lang.Compiler.Ast.SpliceParameterDeclaration node)
		{
			MethodInvocationExpression mie = new MethodInvocationExpression(
					node.LexicalInfo,
					CreateReference(node, "Boo.Lang.Compiler.Ast.SpliceParameterDeclaration"));
			mie.Arguments.Add(Serialize(node.LexicalInfo));
			if (ShouldSerialize(node.Name))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Name"),
						Serialize(node.Name)));
			}
			if (ShouldSerialize(node.Type))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Type"),
						Serialize(node.Type)));
			}
			if (ShouldSerialize(node.Modifiers))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Modifiers"),
						Serialize(node.Modifiers)));
			}
			if (ShouldSerialize(node.Attributes))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "Attributes"),
						SerializeCollection(node, "Boo.Lang.Compiler.Ast.AttributeCollection", node.Attributes)));
			}
			if (ShouldSerialize(node.ParameterDeclaration))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "ParameterDeclaration"),
						Serialize(node.ParameterDeclaration)));
			}
			if (ShouldSerialize(node.NameExpression))
			{
				mie.NamedArguments.Add(
					new ExpressionPair(
						CreateReference(node, "NameExpression"),
						Serialize(node.NameExpression)));
			}
			Push(mie);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:50,代码来源:CodeSerializer.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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