本文整理汇总了C#中ICSharpCode.NRefactory.Ast.AssignmentExpression.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# AssignmentExpression.ToString方法的具体用法?C# AssignmentExpression.ToString怎么用?C# AssignmentExpression.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.NRefactory.Ast.AssignmentExpression
的用法示例。
在下文中一共展示了AssignmentExpression.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TrackedVisitAssignmentExpression
public override object TrackedVisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
{
if (this.FoundResourceSet == null && // skip if already found to improve performance
assignmentExpression.Op == AssignmentOperatorType.Assign && this.PositionAvailable &&
(!this.isLocalVariable || this.resourceManagerMember.Region.IsInside(this.CurrentNodeStartLocation.Y, this.CurrentNodeStartLocation.X)) // skip if local variable is out of scope
) {
IMember resolvedMember = null;
ResolveResult rr = this.Resolve(assignmentExpression.Left);
if (rr != null) {
// Support both local variables and member variables
MemberResolveResult mrr = rr as MemberResolveResult;
if (mrr != null) {
resolvedMember = mrr.ResolvedMember;
} else {
LocalResolveResult lrr = rr as LocalResolveResult;
if (lrr != null) {
resolvedMember = lrr.Field;
}
}
}
if (resolvedMember != null) {
#if DEBUG
LoggingService.Debug("ResourceToolkit: BclNRefactoryResourceResolver: Resolved member: "+resolvedMember.ToString());
#endif
// HACK: The GetType()s are necessary because the DOM IComparable implementations try to cast the parameter object to their own interface type which may fail.
if (resolvedMember.GetType().Equals(this.resourceManagerMember.GetType()) && resolvedMember.CompareTo(this.resourceManagerMember) == 0) {
#if DEBUG
LoggingService.Debug("ResourceToolkit: BclNRefactoryResourceResolver found assignment to field: "+assignmentExpression.ToString());
#endif
data = true;
// Resolving the property association only makes sense if
// there is a possible relationship between the return types
// of the resolved member and the member we are looking for.
} else if (this.compilationUnit != null && !this.isLocalVariable &&
IsTypeRelationshipPossible(resolvedMember, this.resourceManagerMember)) {
if (this.resourceManagerMember is IProperty && resolvedMember is IField) {
// Find out if the resourceManagerMember is a property whose get block returns the value of the resolved member.
// We might already have found this association in the
// resourceManagerFieldAccessedByProperty field.
this.TryResolveResourceManagerProperty();
if (this.resourceManagerFieldAccessedByProperty != null && this.resourceManagerFieldAccessedByProperty.CompareTo(resolvedMember) == 0) {
#if DEBUG
LoggingService.Debug("ResourceToolkit: BclNRefactoryResourceResolver found assignment to field: "+assignmentExpression.ToString());
#endif
data = true;
}
} else if (this.resourceManagerMember is IField && resolvedMember is IProperty) {
// Find out if the resolved member is a property whose set block assigns the value to the resourceManagerMember.
PropertyFieldAssociationVisitor visitor = new PropertyFieldAssociationVisitor((IField)this.resourceManagerMember, this.FileName, this.FileContent);
this.compilationUnit.AcceptVisitor(visitor, null);
if (visitor.AssociatedProperty != null && visitor.AssociatedProperty.CompareTo(resolvedMember) == 0) {
#if DEBUG
LoggingService.Debug("ResourceToolkit: BclNRefactoryResourceResolver found assignment to property: "+assignmentExpression.ToString());
#endif
data = true;
}
}
}
}
}
return base.TrackedVisitAssignmentExpression(assignmentExpression, data);
}