Ejemplo n.º 1
0
        /// <summary>
        /// Tries to handle the ToProvider attribute.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="builder">The builder.</param>
        /// <returns>True if the attribute was found.</returns>
        private static IBindingWhenInNamedWithOrOnSyntax <object> HandleToProviderAttribute(XElement element, IBindingToSyntax <object> builder)
        {
            XAttribute providerAttribute = element.Attribute("toProvider");

            if (providerAttribute == null)
            {
                return(null);
            }

            Type provider = GetTypeFromAttributeValue(providerAttribute);

            return(builder.ToProvider(provider));
        }
        /// <summary>
        /// Tries to handle the ToProvider attribute.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="builder">The builder.</param>
        /// <returns>True if the attribute was found.</returns>
        private static IBindingWhenInNamedWithOrOnSyntax<object> HandleToProviderAttribute(XElement element, IBindingToSyntax<object> builder)
        {
            XAttribute providerAttribute = element.Attribute("toProvider");

            if (providerAttribute == null)
            {
                return null;
            }

            Type provider = GetTypeFromAttributeValue(providerAttribute);
            return builder.ToProvider(provider);
        }