コード例 #1
0
ファイル: ProviderCollection.cs プロジェクト: emtees/old-code
		/// <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
ファイル: ProviderCollection.cs プロジェクト: retahc/old-code
        /// <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
ファイル: ProviderCollection.cs プロジェクト: retahc/old-code
            public ProviderEnumerator(ProviderCollection mappings)
            {
                if (mappings == null)
                {
                    throw new System.ArgumentNullException("mappings");
                }

                this.temp           = ((IEnumerable)(mappings));
                this.baseEnumerator = temp.GetEnumerator();
            }
コード例 #5
0
ファイル: ProviderFactory.cs プロジェクト: emtees/old-code
		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
ファイル: ProviderFactory.cs プロジェクト: retahc/old-code
 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
ファイル: ProviderCollection.cs プロジェクト: retahc/old-code
        /// <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);
            }
        }
コード例 #8
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;
		}
コード例 #9
0
ファイル: ProviderCollection.cs プロジェクト: emtees/old-code
			public ProviderEnumerator(ProviderCollection mappings) 
			{
				if (mappings == null) 
					throw new System.ArgumentNullException ("mappings");

				this.temp = ((IEnumerable)(mappings));
				this.baseEnumerator = temp.GetEnumerator();
			}
コード例 #10
0
ファイル: ProviderCollection.cs プロジェクト: emtees/old-code
		/// <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);
		}