Microsoft.Zing.Splicer.GetContextAttribute C# (CSharp) Méthode

GetContextAttribute() private méthode

private GetContextAttribute ( AttributeList attrs ) : AttributeNode
attrs AttributeList
Résultat AttributeNode
        private AttributeNode GetContextAttribute(AttributeList attrs)
        {
            AttributeNode contextAttr = null;

            if (attrs == null)
                return null;

            for (int i = 0, n = attrs.Count; i < n; i++)
            {
                AttributeNode attr = attrs[i];

                if (attr == null)
                    continue;

                TypeNode attrBase = ((Class)attr.Type).BaseClass;

                if (attrBase.FullName == "Microsoft.Zing.ZingAttribute")
                {
                    // Only attributes derived from this base class may be used
                    // for source context annotation. We currently take only the
                    // first such attribute for our context. We could extend this
                    // to return an array if necessary.
                    contextAttr = attr;
                    break;
                }
            }

            return contextAttr;
        }