|
|
|
@ -626,23 +626,15 @@ namespace ICSharpCode.NRefactory.Parser
@@ -626,23 +626,15 @@ namespace ICSharpCode.NRefactory.Parser
|
|
|
|
|
targetExpr = new CodeThisReferenceExpression(); |
|
|
|
|
} else if (target is FieldReferenceExpression) { |
|
|
|
|
FieldReferenceExpression fRef = (FieldReferenceExpression)target; |
|
|
|
|
targetExpr = (CodeExpression)fRef.TargetObject.AcceptVisitor(this, data); |
|
|
|
|
// Commented out because of SD2-428: Form designer does not load child controls in panels
|
|
|
|
|
//
|
|
|
|
|
// if (fRef.TargetObject is FieldReferenceExpression) {
|
|
|
|
|
// FieldReferenceExpression fRef2 = (FieldReferenceExpression)fRef.TargetObject;
|
|
|
|
|
// if (fRef2.FieldName != null && Char.IsUpper(fRef2.FieldName[0])) {
|
|
|
|
|
// // an exception is thrown if it doesn't end in an indentifier exception
|
|
|
|
|
// // for example for : this.MyObject.MyMethod() leads to an exception, which
|
|
|
|
|
// // is correct in this case ... I know this is really HACKY :)
|
|
|
|
|
// try {
|
|
|
|
|
// CodeExpression tExpr = ConvertToIdentifier(fRef2);
|
|
|
|
|
// if (tExpr != null) {
|
|
|
|
|
// targetExpr = tExpr;
|
|
|
|
|
// }
|
|
|
|
|
// } catch (Exception) {}
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
targetExpr = null; |
|
|
|
|
if (fRef.TargetObject is FieldReferenceExpression) { |
|
|
|
|
if (IsQualIdent((FieldReferenceExpression)fRef.TargetObject)) { |
|
|
|
|
targetExpr = ConvertToIdentifier((FieldReferenceExpression)fRef.TargetObject); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (targetExpr == null) |
|
|
|
|
targetExpr = (CodeExpression)fRef.TargetObject.AcceptVisitor(this, data); |
|
|
|
|
|
|
|
|
|
methodName = fRef.FieldName; |
|
|
|
|
// HACK for : Microsoft.VisualBasic.ChrW(NUMBER)
|
|
|
|
|
if (methodName == "ChrW") { |
|
|
|
@ -914,6 +906,8 @@ namespace ICSharpCode.NRefactory.Parser
@@ -914,6 +906,8 @@ namespace ICSharpCode.NRefactory.Parser
|
|
|
|
|
|
|
|
|
|
bool IsField(string identifier) |
|
|
|
|
{ |
|
|
|
|
if (currentTypeDeclaration == null) // e.g. in unit tests
|
|
|
|
|
return false; |
|
|
|
|
foreach (INode node in currentTypeDeclaration.Children) { |
|
|
|
|
if (node is FieldDeclaration) { |
|
|
|
|
FieldDeclaration fd = (FieldDeclaration)node; |
|
|
|
|