public override object VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data)
 {
     if(memberReferenceExpression.MemberName == "Length")
     {
         var variableName = memberReferenceExpression.Target.GetIdentifier();
         if(memberReferenceExpression.GetVariablesOfInitializer<ArrayCreateExpression>().Any(a => a.Name == variableName))
         {
             UnlockWith(memberReferenceExpression);
         }
         else if(_codebaseDeclarations.Any(a => a.Name == variableName && a.Initializer is ArrayCreateExpression))
         {
             UnlockWith(memberReferenceExpression);
         }
     }
     return base.VisitMemberReferenceExpression(memberReferenceExpression, data);
 }
예제 #2
0
 public override object VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data)
 {
     if (memberReferenceExpression.MemberName == "Length")
     {
         var variableName = memberReferenceExpression.Target.GetIdentifier();
         if (memberReferenceExpression.GetVariablesOfInitializer <ArrayCreateExpression>().Any(a => a.Name == variableName))
         {
             UnlockWith(memberReferenceExpression);
         }
         else if (_codebaseDeclarations.Any(a => a.Name == variableName && a.Initializer is ArrayCreateExpression))
         {
             UnlockWith(memberReferenceExpression);
         }
     }
     return(base.VisitMemberReferenceExpression(memberReferenceExpression, data));
 }