using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.RecipeFramework.Library.CodeModel.Editors;

namespace Microsoft.Practices.RecipeFramework.Extensions.TypeEditor
{
	/// <summary>
	/// Default configuration for CLRTypeEditor
	/// </summary>
	public class DefaultCLRTypeEditorConfig<TFilter>: ICLRTypeEditorConfig
		where TFilter: ICodeModelEditorFilter
	{
		#region ICLRTypeEditorConfig Members

		/// <summary>
		/// <seealso cref="ICLRTypeEditorConfig.BrowseRoot"/>
		/// </summary>
		public virtual CodeModelEditor.BrowseRoot BrowseRoot
		{
			get { return CodeModelEditor.BrowseRoot.Default; }
		}

		/// <summary>
		/// <seealso cref="ICLRTypeEditorConfig.BrowseKind"/>
		/// </summary>
		public virtual CodeModelEditor.BrowseKind BrowseKind
		{
			get { return CodeModelEditor.BrowseKind.Class; }
		}

		/// <summary>
		/// <seealso cref="ICLRTypeEditorConfig.Filter"/>
		/// </summary>
		public virtual Type Filter
		{
			get { return typeof(TFilter); }
		}

		#endregion
	}

	/// <summary>
	/// Default configuration for CLRTypeEditor
	/// </summary>
	public class DefaultCLRTypeEditorConfig : ICLRTypeEditorConfig
	{
		#region ICLRTypeEditorConfig Members

		/// <summary>
		/// <seealso cref="ICLRTypeEditorConfig.BrowseRoot"/>
		/// </summary>
		public CodeModelEditor.BrowseRoot BrowseRoot
		{
			get { return CodeModelEditor.BrowseRoot.Default; }
		}

		/// <summary>
		/// <seealso cref="ICLRTypeEditorConfig.BrowseKind"/>
		/// </summary>
		public CodeModelEditor.BrowseKind BrowseKind
		{
			get { return CodeModelEditor.BrowseKind.Class; }
		}

		/// <summary>
		/// <seealso cref="ICLRTypeEditorConfig.Filter"/>
		/// </summary>
		public Type Filter
		{
			get { return null; }
		}

		#endregion
	}
}
