Exemple #1
0
        /// <summary>
        /// Gets a <see cref="IProviderNode"/> whose anme is <paramref name="name"/>
        /// and belongs to the unamed providers group.
        /// </summary>
        /// <param name="providers">
        /// A <see cref="IProvidersNode"/> taht contains a group whose name is
        /// <see cref="string.Empty"/>.
        /// </param>
        /// <param name="name">
        /// The name of the provider to get.
        /// </param>
        /// <returns></returns>
        public static bool GetProviderNode(this IProvidersNode providers,
                                           string name, out IProviderNode provider)
        {
            IProvidersNodeGroup group;

            if (providers.GetProvidersNodeGroup(string.Empty, out group))
            {
                return(group.GetProviderNode(name, out provider));
            }
            provider = default(IProviderNode);
            return(false);
        }
Exemple #2
0
        /// <summary>
        /// Adds the given <see cref="IProvidersNode"/> object to a empty
        /// <see cref="IProvidersNodeGroup"/> inside the given
        /// <see cref="IProvidersNode"/> object using the given provider name.
        /// </summary>
        /// <param name="nodes">
        /// A <see cref="IProvidersNode"/> object to add the <paramref name="node"/>
        /// </param>
        /// <param name="node">
        /// The <see cref="IProvidersNode"/> object to be added to the
        /// <paramref name="nodes"/>.
        /// </param>
        /// <param name="name">
        /// The name to be associated with the provider node.
        /// </param>
        public static void Add(this IProvidersNode nodes, string name,
                               IProviderNode node)
        {
            IProvidersNodeGroup empty_provider_group;

            if (!nodes.GetProvidersNodeGroup(string.Empty, out empty_provider_group))
            {
                empty_provider_group = new ProvidersNodeGroup();
                nodes.Add(empty_provider_group);
            }
            empty_provider_group.Add(name, node);
        }
Exemple #3
0
 /// <summary>
 /// Gets a <see cref="IProviderNode"/> whose anme is <paramref name="name"/>
 /// and belongs to the unamed providers group.
 /// </summary>
 /// <param name="providers">
 /// A <see cref="IProvidersNode"/> taht contains a group whose name is
 /// <see cref="string.Empty"/>.
 /// </param>
 /// <param name="name">
 /// The name of the provider to get.
 /// </param>
 /// <returns></returns>
 public static IProviderNode GetProviderNode(this IProvidersNode providers,
                                             string name)
 {
     return(providers.GetProvidersNodeGroup(string.Empty).GetProviderNode(name));
 }