Alba.Jaml.XamlGeneration.XamlGenerator.GetXAttrsObjectIds C# (CSharp) Метод

GetXAttrsObjectIds() приватный Метод

Get XAttributes for object identifiers: x:Name/x:Key="objIdExplicit" ImplicitKey="objKeyImplicit".
private GetXAttrsObjectIds ( string objId, TokenTypeInfo objInfo ) : IEnumerable
objId string
objInfo TokenTypeInfo
Результат IEnumerable
        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));
        }