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


C# NamedArgumentExpression类代码示例

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


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

示例1: VisitNamedArgumentExpression

 public virtual void VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression)
 {
     if (this.ThrowException)
     {
         throw (Exception)this.CreateException(namedArgumentExpression);
     }
 }
开发者ID:fabriciomurta,项目名称:BridgeUnified,代码行数:7,代码来源:Visitor.Exception.cs

示例2: VisitNamedArgumentExpression

 public StringBuilder VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, int data)
 {
     throw new SLSharpException("SL# does not support named arguments.");
 }
开发者ID:hach-que,项目名称:SLSharp,代码行数:4,代码来源:VisitorBase.Illegal.cs

示例3: VisitNamedArgumentExpression

        public override void VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression)
        {
            ForceSpacesAfter(namedArgumentExpression.ColonToken, policy.SpaceInNamedArgumentAfterDoubleColon);

            base.VisitNamedArgumentExpression(namedArgumentExpression);
        }
开发者ID:porcus,项目名称:NRefactory,代码行数:6,代码来源:FormattingVisitor_Expressions.cs

示例4: VisitNamedArgumentExpression

		public sealed override object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
			BeginVisit(namedArgumentExpression);
			object result = TrackedVisitNamedArgumentExpression(namedArgumentExpression, data);
			EndVisit(namedArgumentExpression);
			return result;
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:6,代码来源:NodeTrackingAstVisitor.cs

示例5: Visit

			public override object Visit (NewAnonymousType newAnonymousType)
			{
				var result = new AnonymousTypeCreateExpression ();
				foreach (var par in newAnonymousType.Parameters) {
					var location = LocationsBag.GetLocations (par);

					if (location == null) {
						result.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression);
					} else {
						var namedArgument = new NamedArgumentExpression ();
						namedArgument.AddChild (new Identifier (par.Name, Convert (par.Location)), AnonymousTypeCreateExpression.Roles.Identifier);
						namedArgument.AddChild (new CSharpTokenNode (Convert (location [0]), 1), AnonymousTypeCreateExpression.Roles.Assign);
						namedArgument.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression);
						result.AddChild (namedArgument, AnonymousTypeCreateExpression.Roles.Expression);
					}
				}
				return result;
			}
开发者ID:rmattuschka,项目名称:ILSpy,代码行数:18,代码来源:CSharpParser.cs

示例6: ConvertArgument

			Expression ConvertArgument(Argument arg)
			{
				var na = arg as NamedArgument;
				if (na != null) {
					var newArg = new NamedArgumentExpression();
					newArg.AddChild(Identifier.Create(na.Name, Convert(na.Location)), Roles.Identifier);
					
					var loc = LocationsBag.GetLocations(na);
					if (loc != null)
						newArg.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Colon), Roles.Colon);
					
					if (arg.ArgType == Argument.AType.Out || arg.ArgType == Argument.AType.Ref) {
						var direction = new DirectionExpression();
						direction.FieldDirection = arg.ArgType == Argument.AType.Out ? FieldDirection.Out : FieldDirection.Ref;
						var argLocation = LocationsBag.GetLocations(arg);
						if (argLocation != null) {
							var r = arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole;
							direction.AddChild(new CSharpTokenNode(Convert(argLocation [0]), r), r);
						}
						direction.AddChild((Expression)arg.Expr.Accept(this), Roles.Expression);
						newArg.AddChild(direction, Roles.Expression);
					} else {
						newArg.AddChild(na.Expr != null ? (Expression)na.Expr.Accept(this) : new ErrorExpression("Named argument expression parse error"), Roles.Expression);
					}
					return newArg;
				}
				
				if (arg.ArgType == Argument.AType.Out || arg.ArgType == Argument.AType.Ref) {
					var direction = new DirectionExpression();
					direction.FieldDirection = arg.ArgType == Argument.AType.Out ? FieldDirection.Out : FieldDirection.Ref;
					var argLocation = LocationsBag.GetLocations(arg);
					if (argLocation != null) {
						var r = arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole;
						direction.AddChild(new CSharpTokenNode(Convert(argLocation [0]), r), r);
					}
					direction.AddChild((Expression)arg.Expr.Accept(this), Roles.Expression);
					return direction;
				}
				
				return (Expression)arg.Expr.Accept(this);
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:41,代码来源:CSharpParser.cs

示例7: VisitNamedArgumentExpression

		public virtual void VisitNamedArgumentExpression (NamedArgumentExpression namedArgumentExpression)
		{
			VisitChildren (namedArgumentExpression);
		}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:4,代码来源:DepthFirstAstVisitor.cs

示例8: ObjectPropertyInitializerOrVariableInitializer

	void ObjectPropertyInitializerOrVariableInitializer(
#line  1439 "cs.ATG" 
out Expression expr) {

#line  1440 "cs.ATG" 
		expr = null; 
		if (
#line  1442 "cs.ATG" 
IdentAndAsgn()) {
			Identifier();

#line  1444 "cs.ATG" 
			NamedArgumentExpression nae = new NamedArgumentExpression(t.val, null);
			nae.StartLocation = t.Location;
			Expression r = null; 
			Expect(3);
			if (la.kind == 16) {
				CollectionOrObjectInitializer(
#line  1448 "cs.ATG" 
out r);
			} else if (StartOf(31)) {
				VariableInitializer(
#line  1449 "cs.ATG" 
out r);
			} else SynErr(195);

#line  1450 "cs.ATG" 
			nae.Expression = r; nae.EndLocation = t.EndLocation; expr = nae; 
		} else if (StartOf(31)) {
			VariableInitializer(
#line  1452 "cs.ATG" 
out expr);
		} else SynErr(196);
	}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:34,代码来源:Parser.cs

示例9: VisitNamedArgumentExpression

		public virtual void VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression)
		{
			DebugExpression(namedArgumentExpression);
			StartNode(namedArgumentExpression);
			WriteIdentifier(namedArgumentExpression.NameToken);
			WriteToken(Roles.Colon, BoxedTextColor.Punctuation);
			Space();
			namedArgumentExpression.Expression.AcceptVisitor(this);
			EndNode(namedArgumentExpression);
		}
开发者ID:0xd4d,项目名称:NRefactory,代码行数:10,代码来源:CSharpOutputVisitor.cs

示例10: VisitNamedArgumentExpression

        public void VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression)
        {
            JsonObject expression = CreateJsonExpression(namedArgumentExpression);
            expression.AddJsonValue("identifier", GetIdentifier(namedArgumentExpression.NameToken));
            expression.AddJsonValue("expression", GenExpression(namedArgumentExpression.Expression));

            Push(expression);
            throw new FirstTimeUseException();
        }
开发者ID:CompilerKit,项目名称:CodeWalk,代码行数:9,代码来源:AstCsToJson.cs

示例11: VisitNamedArgumentExpression

		public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
			Debug.Assert((namedArgumentExpression != null));
			Debug.Assert((namedArgumentExpression.Expression != null));
			return namedArgumentExpression.Expression.AcceptVisitor(this, data);
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:5,代码来源:AbstractASTVisitor.cs

示例12: VisitNamedArgumentExpression

 public void VisitNamedArgumentExpression(NamedArgumentExpression node)
 {
     node.Expression.AcceptVisitor(this);
     node.ReplaceWith(node.Expression);
 }
开发者ID:evanw,项目名称:minisharp,代码行数:5,代码来源:Lower.cs

示例13: VisitNamedArgumentExpression

		public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
			throw new global::System.NotImplementedException("NamedArgumentExpression");
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:3,代码来源:NotImplementedAstVisitor.cs

示例14: VisitNamedArgumentExpression

		public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
			Debug.Assert((namedArgumentExpression != null));
			Debug.Assert((namedArgumentExpression.Expression != null));
			nodeStack.Push(namedArgumentExpression.Expression);
			namedArgumentExpression.Expression.AcceptVisitor(this, data);
			namedArgumentExpression.Expression = ((Expression)(nodeStack.Pop()));
			return null;
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:8,代码来源:AbstractAstTransformer.cs

示例15: AddArgument

		static void AddArgument(InvocationExpression newNode, IParameter parameterToAdd, bool isNextInSequence)
		{
			Expression defaultValue;
			if (parameterToAdd.ConstantValue == null) {
				defaultValue = new NullReferenceExpression();
			}
			else {
				defaultValue = new PrimitiveExpression(parameterToAdd.ConstantValue);
			}
			Expression newArgument;
			if (newNode.Arguments.Any(argument => argument is NamedExpression) || !isNextInSequence) {
				newArgument = new NamedArgumentExpression(parameterToAdd.Name, defaultValue);
			}
			else {
				newArgument = defaultValue;
			}
			newNode.Arguments.Add(newArgument);
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:18,代码来源:AddOptionalParameterToInvocationAction.cs


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