//===============================================================================
// Microsoft patterns & practices
// Web Service Software Factory
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Microsoft.Practices.SoftwareFactories.ServiceFactory.Editors.Grid.Design
{
    /// <summary>
    /// Proxy for siting the designer column
    /// </summary>
	public class SiteProxy : ISite
	{
		ISite realSite;

        /// <summary>
        /// Initializes a new instance of the <see cref="T:SiteProxy"/> class.
        /// </summary>
        /// <param name="realSite">The real site.</param>
		public SiteProxy(ISite realSite)
		{
			this.realSite = realSite;
		}

		#region ISite Members

        /// <summary>
        /// Gets the component associated with the <see cref="T:System.ComponentModel.ISite"></see> when implemented by a class.
        /// </summary>
        /// <value></value>
        /// <returns>The <see cref="T:System.ComponentModel.IComponent"></see> instance associated with the <see cref="T:System.ComponentModel.ISite"></see>.</returns>
		public IComponent Component
		{
			get { return realSite.Component; }
		}

        /// <summary>
        /// Gets the <see cref="T:System.ComponentModel.IContainer"></see> associated with the <see cref="T:System.ComponentModel.ISite"></see> when implemented by a class.
        /// </summary>
        /// <value></value>
        /// <returns>The <see cref="T:System.ComponentModel.IContainer"></see> instance associated with the <see cref="T:System.ComponentModel.ISite"></see>.</returns>
		public IContainer Container
		{
			get { return realSite.Container; }
		}

        /// <summary>
        /// Determines whether the component is in design mode when implemented by a class.
        /// </summary>
        /// <value></value>
        /// <returns>true if the component is in design mode; otherwise, false.</returns>
		public bool DesignMode
		{
			get { return realSite.DesignMode; }
		}

        /// <summary>
        /// Gets or sets the name of the component associated with the <see cref="T:System.ComponentModel.ISite"></see> when implemented by a class.
        /// </summary>
        /// <value></value>
        /// <returns>The name of the component associated with the <see cref="T:System.ComponentModel.ISite"></see>; or null, if no name is assigned to the component.</returns>
		public string Name
		{
			get { return realSite.Name; }
			set { }
		}

		#endregion

		#region IServiceProvider Members

        /// <summary>
        /// Gets the service object of the specified type.
        /// </summary>
        /// <param name="serviceType">An object that specifies the type of service object to get.</param>
        /// <returns>
        /// A service object of type serviceType.-or- null if there is no service object of type serviceType.
        /// </returns>
		public object GetService(Type serviceType)
		{
			return realSite.GetService(serviceType);
		}

		#endregion
	}
}
