예제 #1
0
		/// <summary>
		///     <para>
		///       Initializes a new instance of <see cref='.ProviderCollection'/> based on another <see cref='.ProviderCollection'/>.
		///    </para>
		/// </summary>
		/// <param name='value'>
		///       A <see cref='.ProviderCollection'/> from which the contents are copied
		/// </param>
		public ProviderCollection (ProviderCollection value) 
		{
			if (value == null) 
				throw new System.ArgumentNullException ("value");

			this.AddRange (value);
		}
예제 #2
0
        public virtual object Create(object parent, object configContext, XmlNode section)
        {
            if (section == null)
            {
                throw new System.ArgumentNullException("section");
            }

            ProviderCollection providers = new ProviderCollection();

            XmlNodeList ProviderList = section.SelectNodes("./provider");

            foreach (XmlNode ProviderNode in ProviderList)
            {
                Provider provider = new Provider(
                    GetStringValue(ProviderNode, "name", true),
                    GetStringValue(ProviderNode, "connection", true),
                    GetStringValue(ProviderNode, "adapter", true),
                    GetStringValue(ProviderNode, "command", true),
                    GetStringValue(ProviderNode, "assembly", true),
                    GetStringValue(ProviderNode, "description", false),
                    GetStringValue(ProviderNode, "parameterprefix", false),
                    GetStringValue(ProviderNode, "commandbuilder", false));
                providers.Add(provider);
            }
            return(providers);
        }
예제 #3
0
        /// <summary>
        ///     <para>
        ///       Initializes a new instance of <see cref='.ProviderCollection'/> based on another <see cref='.ProviderCollection'/>.
        ///    </para>
        /// </summary>
        /// <param name='value'>
        ///       A <see cref='.ProviderCollection'/> from which the contents are copied
        /// </param>
        public ProviderCollection(ProviderCollection value)
        {
            if (value == null)
            {
                throw new System.ArgumentNullException("value");
            }

            this.AddRange(value);
        }
예제 #4
0
            public ProviderEnumerator(ProviderCollection mappings)
            {
                if (mappings == null)
                {
                    throw new System.ArgumentNullException("mappings");
                }

                this.temp           = ((IEnumerable)(mappings));
                this.baseEnumerator = temp.GetEnumerator();
            }
예제 #5
0
		static ProviderFactory ()
		{
			providers = (ProviderCollection) ConfigurationSettings.GetConfig ("mono.data/providers");
			if (providers == null) {
				providers = new ProviderCollection ();
				// warn the developer or administrator that the provider list is empty
				System.Diagnostics.Debug.Listeners.Add (new System.Diagnostics.TextWriterTraceListener (Console.Out));
				System.Diagnostics.Debug.WriteLine ("No providers found. Did you set up a mono.data/providers area in your app.config or in machine.config?");
			}

		}
예제 #6
0
 static ProviderFactory()
 {
     providers = (ProviderCollection)ConfigurationSettings.GetConfig("mono.data/providers");
     if (providers == null)
     {
         providers = new ProviderCollection();
         // warn the developer or administrator that the provider list is empty
         System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(Console.Out));
         System.Diagnostics.Debug.WriteLine("No providers found. Did you set up a mono.data/providers area in your app.config or in machine.config?");
     }
 }
예제 #7
0
        /// <summary>
        ///     <para>
        ///       Adds the contents of another <see cref='.ProviderCollection'/> to the end of the collection.
        ///    </para>
        /// </summary>
        /// <param name='value'>
        ///    A <see cref='.ProviderCollection'/> containing the objects to add to the collection.
        /// </param>
        /// <returns>
        ///   <para>None.</para>
        /// </returns>
        /// <seealso cref='.ProviderCollection.Add'/>
        public void AddRange(ProviderCollection value)
        {
            if (value == null)
            {
                throw new System.ArgumentNullException("value");
            }

            foreach (Provider p in value)
            {
                this.Add(p);
            }
        }
		public virtual object Create (object parent, object configContext, XmlNode section)
		{
			if (section == null)
				throw new System.ArgumentNullException ("section");

			ProviderCollection providers = new ProviderCollection ();
			
			XmlNodeList ProviderList = section.SelectNodes ("./provider");

			foreach (XmlNode ProviderNode in ProviderList) {
				Provider provider = new Provider(
					GetStringValue (ProviderNode, "name", true),
					GetStringValue (ProviderNode, "connection", true),
					GetStringValue (ProviderNode, "adapter", true),
					GetStringValue (ProviderNode, "command", true),
					GetStringValue (ProviderNode, "assembly", true),
					GetStringValue (ProviderNode, "description", false),
					GetStringValue (ProviderNode, "parameterprefix", false),
					GetStringValue (ProviderNode, "commandbuilder", false));
				providers.Add (provider);
			}
			return providers;
		}
예제 #9
0
			public ProviderEnumerator(ProviderCollection mappings) 
			{
				if (mappings == null) 
					throw new System.ArgumentNullException ("mappings");

				this.temp = ((IEnumerable)(mappings));
				this.baseEnumerator = temp.GetEnumerator();
			}
예제 #10
0
		/// <summary>
		///     <para>
		///       Adds the contents of another <see cref='.ProviderCollection'/> to the end of the collection.
		///    </para>
		/// </summary>
		/// <param name='value'>
		///    A <see cref='.ProviderCollection'/> containing the objects to add to the collection.
		/// </param>
		/// <returns>
		///   <para>None.</para>
		/// </returns>
		/// <seealso cref='.ProviderCollection.Add'/>
		public void AddRange(ProviderCollection value) 
		{
			if (value == null) 
				throw new System.ArgumentNullException ("value");

			foreach (Provider p in value)
				this.Add (p);
		}