Class ViewEngineCollection
Represents a collection of view engines that are available to the application.
public class ViewEngineCollection : Collection<IViewEngine>, IList<IViewEngine>, ICollection<IViewEngine>, IList, ICollection, IReadOnlyList<IViewEngine>, IReadOnlyCollection<IViewEngine>, IEnumerable<IViewEngine>, IEnumerable
- Inheritance
-
ViewEngineCollection
- Implements
- Inherited Members
Constructors
ViewEngineCollection()
Initializes a new instance of the ViewEngineCollection class.
public ViewEngineCollection()
ViewEngineCollection(IList<IViewEngine>)
Initializes a new instance of the ViewEngineCollection class using the specified list of view engines.
public ViewEngineCollection(IList<IViewEngine> list)
Parameters
listIList<IViewEngine>The list that is wrapped by the new collection.
Exceptions
- ArgumentNullException
listis null.
Methods
ClearItems()
Removes all elements from the Collection<T>.
protected override void ClearItems()
FindPartialView(ControllerContext, string)
Finds the specified partial view by using the specified controller context.
public virtual ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName)
Parameters
controllerContextControllerContextThe controller context.
partialViewNamestringThe name of the partial view.
Returns
- ViewEngineResult
The partial view.
Exceptions
- ArgumentNullException
The
controllerContextparameter is null.- ArgumentException
The
partialViewNameparameter is null or empty.
FindView(ControllerContext, string, string)
Finds the specified view by using the specified controller context and master view.
public virtual ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName)
Parameters
controllerContextControllerContextThe controller context.
viewNamestringThe name of the view.
masterNamestringThe name of the master view.
Returns
- ViewEngineResult
The view.
Exceptions
- ArgumentNullException
The
controllerContextparameter is null.- ArgumentException
The
partialViewNameparameter is null or empty.
InsertItem(int, IViewEngine)
Inserts an element into the collection at the specified index.
protected override void InsertItem(int index, IViewEngine item)
Parameters
indexintThe zero-based index at which item should be inserted.
itemIViewEngineThe object to insert.
Exceptions
- ArgumentOutOfRangeException
indexis less than zero.-or-indexis greater than the number of items in the collection.- ArgumentNullException
The
itemparameter is null.
RemoveItem(int)
Removes the element at the specified index of the Collection<T>.
protected override void RemoveItem(int index)
Parameters
indexintThe zero-based index of the element to remove.
Exceptions
- ArgumentOutOfRangeException
indexis less than zero.-or-indexis equal to or greater than Count
SetItem(int, IViewEngine)
Replaces the element at the specified index.
protected override void SetItem(int index, IViewEngine item)
Parameters
indexintThe zero-based index of the element to replace.
itemIViewEngineThe new value for the element at the specified index.
Exceptions
- ArgumentOutOfRangeException
indexis less than zero.-or-indexis greater than the number of items in the collection.- ArgumentNullException
The
itemparameter is null.