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


C# Expression.AppendMemberReference方法代码示例

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


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

示例1: getProperties

		private List<ObjectGraphProperty> getProperties(Expression expression, DebugType shownType, BindingFlags flags)
		{
			List<ObjectGraphProperty> propertyList = new List<ObjectGraphProperty>();
			
			foreach (MemberInfo memberProp in shownType.GetFieldsAndNonIndexedProperties(flags))
			{
				if (memberProp.Name.Contains("<")) {
					// skip backing fields
					continue;
				}
				if (memberProp.DeclaringType != shownType) {
					// skip properties declared in the base type
					continue;
				}

				// ObjectGraphProperty needs an expression
				// to know whether it is expanded, and to evaluate
				Expression propExpression = expression.AppendMemberReference((IDebugMemberInfo)memberProp);
				// Value, IsAtomic are lazy evaluated
				propertyList.Add(new ObjectGraphProperty
				                 { Name = memberProp.Name,
				                 	Expression = propExpression, Value = "",
				                 	MemberInfo = memberProp, IsAtomic = true, TargetNode = null });
				
			}
			return propertyList.Sorted(ObjectPropertyComparer.Instance);
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:27,代码来源:ObjectGraphBuilder.cs

示例2: LazyGetMembersOfObject

		public static IEnumerable<TreeNode> LazyGetMembersOfObject(TreeNode parent, Expression expression, MemberInfo[] members)
		{
			List<TreeNode> nodes = new List<TreeNode>();
			foreach(MemberInfo memberInfo in members) {
				string imageName;
				var image = ExpressionNode.GetImageForMember((IDebugMemberInfo)memberInfo, out imageName);
				var exp = new ExpressionNode(parent, image, memberInfo.Name, expression.AppendMemberReference((IDebugMemberInfo)memberInfo));
				exp.ImageName = imageName;
				nodes.Add(exp);
			}
			nodes.Sort();
			return nodes;
		}
开发者ID:OmerRaviv,项目名称:SharpDevelop,代码行数:13,代码来源:ChildNodesOfObject.cs

示例3: LazyGetMembersOfObject

		public static IEnumerable<TreeNode> LazyGetMembersOfObject(Expression expression, MemberInfo[] members)
		{
			List<TreeNode> nodes = new List<TreeNode>();
			foreach(MemberInfo memberInfo in members) {
				nodes.Add(new ExpressionNode(ExpressionNode.GetImageForMember((IDebugMemberInfo)memberInfo), memberInfo.Name, expression.AppendMemberReference((IDebugMemberInfo)memberInfo)));
			}
			nodes.Sort();
			return nodes;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:9,代码来源:ChildNodesOfObject.cs


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