|
//===========================================
// MVC# Framework | www.MVCSharp.org |
// ------------------------------------------
// Copyright (C) 2008 www.MVCSharp.org |
// All rights reserved. |
//===========================================
using System.Collections;
using System;
namespace MVCSharp.Core.Configuration.Views
{
#region Documentation
/// <summary>
/// Represents an enumerable set of <see cref="ViewInfoCollection"/> objects for each
/// task type. Thus includes descriptions for all views in the
/// application.
/// </summary>
/// <remarks>This collection is a part of the <see cref="MVCConfiguration"/>
/// object: when a task is started the necessary <c>ViewInfoCollection</c> object is
/// obtained from the <see cref="MVCConfiguration.ViewInfosByTask"/> property.
/// </remarks>
#endregion
public class ViewInfosByTaskCollection : IEnumerable
{
#region Documentation
/// <summary>
/// Hashtable storing ViewInfoCollection objects with task types as keys.
/// </summary>
#endregion
protected Hashtable viewInfosByTask = new Hashtable();
#region Documentation
/// <summary>
/// Indexer to get or set ViewInfoCollection instance for a given task type.
/// </summary>
#endregion
public ViewInfoCollection this[Type taskType]
{
get
{
return viewInfosByTask[taskType] as ViewInfoCollection;
}
set
{
viewInfosByTask[taskType] = value;
}
}
#region Documentation
/// <summary>
/// Gets the number of <c>ViewInfoCollection</c> objects
/// present in this collection.
/// </summary>
#endregion
public int Count
{
get { return viewInfosByTask.Count; }
}
#region Documentation
/// <summary>
/// Adds all items from another <c>ViewInfosByTaskCollection</c>
/// collection to this one.
/// </summary>
#endregion
public void Add(ViewInfosByTaskCollection viewInfBTColl)
{
foreach (Type t in viewInfBTColl)
this[t] = viewInfBTColl[t];
}
#region Documentation
/// <summary>
/// Implementation of <see cref="IEnumerable.GetEnumerator"/> method.
/// Returns an enumerator to walk through the task types included
/// in this collection.
/// </summary>
#endregion
public IEnumerator GetEnumerator()
{
return viewInfosByTask.Keys.GetEnumerator();
}
}
}
|
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.
Oleg Zhukov, born and living in Russia is Lead Engineer and Project Manager in a company which provides business software solutions. He has graduated from Moscow Institute of Physics and Technology (MIPT) (department of system programming) and has got a M.S. degree in applied physics and mathematics. His research and development work concerns architectural patterns, domain-driven development and systems analysis. Being the adherent of agile methods he applies them extensively in the projects managed by him.