Class PageObjectExtentions
Helper class with extension methods for page objects.
Inheritance
System.Object
PageObjectExtentions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 7.19.2Syntax
public static class PageObjectExtentions
Methods
ItemAs<TObject>(IDictionary<String, Object>, String)
Returns an item from the dictionary as the type specified in the TObject
parameter
Declaration
public static TObject ItemAs<TObject>(this IDictionary<string, object> dictionary, string key)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> | dictionary | The dictionary instance to operate on |
System.String | key | The dictionary key for the item to retreive. |
Returns
Type | Description |
---|---|
TObject | A object instance or null if not found |
Type Parameters
Name | Description |
---|---|
TObject | The System.Type to cast the objec to |
Remarks
If the object is not of type TObject
then an System.InvalidCastException exception will be thrown