private string GetChoiceIdentifierSource(MemberMapping[] mappings, MemberMapping member)
{
string choiceSource = null;
if (member.ChoiceIdentifier != null)
{
for (int j = 0; j < mappings.Length; j++)
{
if (mappings[j].Name == member.ChoiceIdentifier.MemberName)
{
choiceSource = "p[" + j.ToString(CultureInfo.InvariantCulture) + "]";
break;
}
}
#if DEBUG
// use exception in the place of Debug.Assert to avoid throwing asserts from a server process such as aspnet_ewp.exe
if (choiceSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.ChoiceIdentifier.MemberName + " in the members mapping."));
#endif
}
return choiceSource;
}