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

ContextAttributeConstructor() private méthode

private ContextAttributeConstructor ( AttributeList attrs ) : Expression
attrs AttributeList
Résultat Expression
        internal Expression ContextAttributeConstructor(AttributeList attrs)
        {
            AttributeNode contextAttr = this.GetContextAttribute(attrs);

            if (contextAttr == null)
                return new Literal(null, SystemTypes.Object);

            Duplicator duplicator = new Duplicator(null, null);
            AttributeNode dupAttr = duplicator.VisitAttributeNode(contextAttr);

            Construct cons = (Construct)Templates.GetExpressionTemplate("ContextAttributeConstructor");

            Replacer.Replace(cons, "_AttributeName", dupAttr.Type.Name);

            Normalizer normalizer = new Normalizer(false);
            cons.Operands = normalizer.VisitExpressionList(dupAttr.Expressions);

            return cons;
        }