Esempio n. 1
0
 protected static ProviderOptionsNode GetOptions(string name,
                                                 XmlElement element,
                                                 out IList <string> options_references)
 {
     foreach (XmlNode node in element.ChildNodes)
     {
         if (node.NodeType == XmlNodeType.Element &&
             Strings.AreEquals(node.Name, Strings.kOptionsNodeName))
         {
             return(ProviderOptionsNode
                    .Parse(name, (XmlElement)node, out options_references));
         }
     }
     options_references = new List <string>();
     return(new ProviderOptionsNode(name));
 }
Esempio n. 2
0
        static void ParseReferenceTable(XmlElement element,
                                        IList <UnresolvedOptions> unresolved_options_references,
                                        IDictionary <string, IProviderOptions> reference_table)
        {
            IList <string> references;

            string name = GetAttributeValue(element, Strings.kNameAttribute);
            ProviderOptionsNode options =
                ProviderOptionsNode.Parse(name, element, out references);

            // Add the provider options to the unresolved options list if it has
            // references to be resolved.
            if (references.Count > 0)
            {
                unresolved_options_references
                .Add(new UnresolvedOptions(options, references));
            }
            reference_table.Add(options.Name, options);
        }
Esempio n. 3
0
        static IProviderOptions GetOptions(string name, XmlElement element)
        {
            IList <string> options_references = new List <string>();

            foreach (XmlNode node in element.ChildNodes)
            {
                if (node.NodeType == XmlNodeType.Element &&
                    Strings.AreEquals(node.Name, Strings.kOptionsNodeName))
                {
                    IProviderOptions options = ProviderOptionsNode
                                               .Parse(name, (XmlElement)node, out options_references);

                    // replicas could nt have referential options.
                    if (options_references.Count != 0)
                    {
                        throw new ConfigurationException(
                                  Resources.Resources.
                                  Configuration_providers_replicas_with_ref_options);
                    }
                    return(options);
                }
            }
            return(new ProviderOptionsNode(name));
        }