internal string GetStringForMember(string obj, string memberName, TypeDesc typeDesc)
{
if (!typeDesc.UseReflection)
return obj + ".@" + memberName;
TypeDesc saveTypeDesc = typeDesc;
while (typeDesc != null)
{
string typeFullName = typeDesc.CSharpName;
string memberInfoName = GetReflectionVariable(typeFullName, memberName);
if (memberInfoName != null)
return memberInfoName + "[" + obj + "]";
// member may be part of the basetype
typeDesc = typeDesc.BaseTypeDesc;
if (typeDesc != null && !typeDesc.UseReflection)
return "((" + typeDesc.CSharpName + ")" + obj + ").@" + memberName;
}
//throw GetReflectionVariableException(saveTypeDesc.CSharpName,memberName);
// NOTE, sowmys:Must never happen. If it does let the code
// gen continue to help debugging what's gone wrong.
// Eventually the compilation will fail.
return "[" + obj + "]";
}
/*