本文整理汇总了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);
}
示例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;
}
示例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;
}