Click here to Skip to main content
15,886,815 members
Articles / Programming Languages / XML

Learn How to Build a Provider Framework - With an Easy to Understand Example Towards Applying the Provider Pattern

Rate me:
Please Sign up or sign in to vote.
4.52/5 (43 votes)
20 Jul 2007CPOL14 min read 109.9K   590   154  
After reading this article, you'll be able to: (1) Change your mindset a little bit, and start thinking about 'frameworks' instead of just 'code' (2) Understand a lot about practically applying the Provider pattern in your projects (3) Gain much knowledge regarding XML config files and providers.
// Copyright 2004, Microsoft Corporation
// Sample Code - Use restricted to terms of use defined in the accompanying license agreement (EULA.doc)

//--------------------------------------------------------------
// Autogenerated by XSDObjectGen version 1.4.4.1
// Schema file: Publisher.xsd
// Creation Date: 1/8/2007 2:23:59 PM
//--------------------------------------------------------------

using System;
using System.Xml.Serialization;
using System.Collections;
using System.Xml.Schema;
using System.ComponentModel;

namespace Sumeru.Publisher.Framework.Data
{

	public struct Declarations
	{
		public const string SchemaVersion = "http://tempuri.org/Publisher.xsd";
	}


	[Serializable]
	[EditorBrowsable(EditorBrowsableState.Advanced)]
	public class SettingCollection : ArrayList
	{
		public Sumeru.Publisher.Framework.Data.Setting Add(Sumeru.Publisher.Framework.Data.Setting obj)
		{
			base.Add(obj);
			return obj;
		}

		public Sumeru.Publisher.Framework.Data.Setting Add()
		{
			return Add(new Sumeru.Publisher.Framework.Data.Setting());
		}

		public void Insert(int index, Sumeru.Publisher.Framework.Data.Setting obj)
		{
			base.Insert(index, obj);
		}

		public void Remove(Sumeru.Publisher.Framework.Data.Setting obj)
		{
			base.Remove(obj);
		}

		new public Sumeru.Publisher.Framework.Data.Setting this[int index]
		{
			get { return (Sumeru.Publisher.Framework.Data.Setting) base[index]; }
			set { base[index] = value; }
		}
	}

	[Serializable]
	[EditorBrowsable(EditorBrowsableState.Advanced)]
	public class PublisherCollection : ArrayList
	{
		public Sumeru.Publisher.Framework.Data.Publisher Add(Sumeru.Publisher.Framework.Data.Publisher obj)
		{
			base.Add(obj);
			return obj;
		}

		public Sumeru.Publisher.Framework.Data.Publisher Add()
		{
			return Add(new Sumeru.Publisher.Framework.Data.Publisher());
		}

		public void Insert(int index, Sumeru.Publisher.Framework.Data.Publisher obj)
		{
			base.Insert(index, obj);
		}

		public void Remove(Sumeru.Publisher.Framework.Data.Publisher obj)
		{
			base.Remove(obj);
		}

		new public Sumeru.Publisher.Framework.Data.Publisher this[int index]
		{
			get { return (Sumeru.Publisher.Framework.Data.Publisher) base[index]; }
			set { base[index] = value; }
		}
	}



	[XmlRoot(ElementName="Setting",Namespace=Declarations.SchemaVersion,IsNullable=false),Serializable]
	public class Setting
	{

		[XmlAttribute(AttributeName="Key",DataType="string")]
		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public string __Key;
		
		[XmlIgnore]
		public string Key
		{ 
			get { return __Key; }
			set { __Key = value; }
		}

		[XmlAttribute(AttributeName="Value",DataType="string")]
		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public string __Value;
		
		[XmlIgnore]
		public string @Value
		{ 
			get { return __Value; }
			set { __Value = value; }
		}

		public Setting()
		{
		}
	}


	[XmlRoot(ElementName="Publisher",Namespace=Declarations.SchemaVersion,IsNullable=false),Serializable]
	public class Publisher
	{
		[System.Runtime.InteropServices.DispIdAttribute(-4)]
		public IEnumerator GetEnumerator() 
		{
            return SettingCollection.GetEnumerator();
		}

		public Sumeru.Publisher.Framework.Data.Setting Add(Sumeru.Publisher.Framework.Data.Setting obj)
		{
			return SettingCollection.Add(obj);
		}

		[XmlIgnore]
		public Sumeru.Publisher.Framework.Data.Setting this[int index]
		{
			get { return (Sumeru.Publisher.Framework.Data.Setting) SettingCollection[index]; }
		}

		[XmlIgnore]
        public int Count 
		{
            get { return SettingCollection.Count; }
        }

        public void Clear()
		{
			SettingCollection.Clear();
        }

		public Sumeru.Publisher.Framework.Data.Setting Remove(int index) 
		{ 
            Sumeru.Publisher.Framework.Data.Setting obj = SettingCollection[index];
            SettingCollection.Remove(obj);
			return obj;
        }

        public void Remove(object obj)
		{
            SettingCollection.Remove(obj);
        }

		[XmlAttribute(AttributeName="Name",DataType="string")]
		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public string __Name;
		
		[XmlIgnore]
		public string Name
		{ 
			get { return __Name; }
			set { __Name = value; }
		}

		[XmlAttribute(AttributeName="AssemblyName",DataType="string")]
		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public string __AssemblyName;
		
		[XmlIgnore]
		public string AssemblyName
		{ 
			get { return __AssemblyName; }
			set { __AssemblyName = value; }
		}

		[XmlAttribute(AttributeName="ClassName",DataType="string")]
		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public string __ClassName;
		
		[XmlIgnore]
		public string ClassName
		{ 
			get { return __ClassName; }
			set { __ClassName = value; }
		}

		[XmlAttribute(AttributeName="Version",DataType="string")]
		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public string __Version;
		
		[XmlIgnore]
		public string Version
		{ 
			get { return __Version; }
			set { __Version = value; }
		}

		[XmlElement(Type=typeof(Sumeru.Publisher.Framework.Data.Setting),ElementName="Setting",IsNullable=false,Form=XmlSchemaForm.Qualified,Namespace=Declarations.SchemaVersion)]
		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public SettingCollection __SettingCollection;
		
		[XmlIgnore]
		public SettingCollection SettingCollection
		{
			get
			{
				if (__SettingCollection == null) __SettingCollection = new SettingCollection();
				return __SettingCollection;
			}
			set {__SettingCollection = value;}
		}

		public Publisher()
		{
		}
	}


	[XmlRoot(ElementName="Publishers",Namespace=Declarations.SchemaVersion,IsNullable=false),Serializable]
	public class Publishers
	{
		[System.Runtime.InteropServices.DispIdAttribute(-4)]
		public IEnumerator GetEnumerator() 
		{
            return PublisherCollection.GetEnumerator();
		}

		public Sumeru.Publisher.Framework.Data.Publisher Add(Sumeru.Publisher.Framework.Data.Publisher obj)
		{
			return PublisherCollection.Add(obj);
		}

		[XmlIgnore]
		public Sumeru.Publisher.Framework.Data.Publisher this[int index]
		{
			get { return (Sumeru.Publisher.Framework.Data.Publisher) PublisherCollection[index]; }
		}

		[XmlIgnore]
        public int Count 
		{
            get { return PublisherCollection.Count; }
        }

        public void Clear()
		{
			PublisherCollection.Clear();
        }

		public Sumeru.Publisher.Framework.Data.Publisher Remove(int index) 
		{ 
            Sumeru.Publisher.Framework.Data.Publisher obj = PublisherCollection[index];
            PublisherCollection.Remove(obj);
			return obj;
        }

        public void Remove(object obj)
		{
            PublisherCollection.Remove(obj);
        }

		[XmlAttribute(AttributeName="Version",DataType="string")]
		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public string __Version;
		
		[XmlIgnore]
		public string Version
		{ 
			get { return __Version; }
			set { __Version = value; }
		}

		[XmlElement(Type=typeof(Sumeru.Publisher.Framework.Data.Publisher),ElementName="Publisher",IsNullable=false,Form=XmlSchemaForm.Qualified,Namespace=Declarations.SchemaVersion)]
		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public PublisherCollection __PublisherCollection;
		
		[XmlIgnore]
		public PublisherCollection PublisherCollection
		{
			get
			{
				if (__PublisherCollection == null) __PublisherCollection = new PublisherCollection();
				return __PublisherCollection;
			}
			set {__PublisherCollection = value;}
		}

		public Publishers()
		{
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
Architect, Developer, Speaker | Wannabe GUT inventor & Data Scientist | Microsoft MVP in C#

Comments and Discussions