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


C# AssignmentExpression.ToString方法代码示例

本文整理汇总了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);
            }
开发者ID:ichengzi,项目名称:SharpDevelop,代码行数:77,代码来源:BclNRefactoryResourceResolver.cs


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