private IEnumerable<XAttribute> GetXAttrsObjectIds (string objId, TokenTypeInfo objInfo)
{
if (objId == null)
yield break;
string objIdExplicit = objId, objIdImplicit = null, propKey = GetObjectImplicitKeyPropName(objInfo), typeName = null;
if (propKey != null) {
int spacePos = objId.IndexOf(' ');
if (spacePos != -1) {
objIdExplicit = objId.Substring(0, spacePos);
objIdImplicit = objId.Substring(spacePos + 1);
}
else {
objIdExplicit = null;
objIdImplicit = objId;
}
Type propKeyType = GetPropertyType(objInfo.Type, propKey);
if (propKeyType == typeof(Type)) {
typeName = objIdImplicit;
objIdImplicit = String.Format("{{x:Type {0}}}", objIdImplicit);
}
}
if (typeName != null)
objInfo.TargetType = GetTypeByName(typeName);
bool isContDict = objInfo.PropertyContainerType != null && IsTypeDictionary(objInfo.PropertyContainerType);
if (objIdExplicit != null)
yield return new XAttribute(
NsX + (isContDict ? XamlLanguage.Key.Name : XamlLanguage.Name.Name),
objIdExplicit);
if (objIdImplicit != null)
yield return new XAttribute(propKey, FormatScalarPropertyValue(objIdImplicit));
}