CodeGarden 10: The sixth annual Umbraco Developer Conference
June 23-25th 2010 - free ASP.NET MVC pre-conference. Register today!

DocTypeBase

Pages

Construct

public class DocTypeBase : System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged { }

 Purpose

Provides the base class framework for an Umbraco item. This class has the properties which are common to all generated classes such as:

- Id

- Unique Id

- CreateDate

- ModifiedDate

- Version

- Parent

- Children

- Writer

- Creator

- Name

Properties and Methods

 

public AssociationTree<DocTypeBase> Children { get; } 

Purpose

Returns all direct children of the current instance down-cast to the base class of DocTypeBase. Each child must be recast before they can be used as their actual type.

 

public virtual TParent Parent<TParent>() where TParent : DocTypeBase, new() { }

Purpose 

Returns the parent of the current instance as the provided type. If the type is not correct and exception will be thrown.

 

public TDocType AncestorOrDefault<TDocType>() where TDocType : DocTypeBase { }

Purpose

Returns the first matching ancestor of the current instance based on the type provided. If the provided type does not match any ancestor then the method will return null.

 

public TDocType AncestorOrDefault<TDocType>(Func<TDocType, bool> func) where TDocType : DocTypeBase { }

Purpose

Returns the first matching ancestor of the current instance based on the type provided and an additional boolean function. If the provided type and function do not match any ancestor then the method will return null.

 

XML Documentation

        <member name="T:umbraco.Linq.Core.DocTypeBase">
<summary>
Provides the base framework for an umbraco item
</summary>
</member>
<member name="M:umbraco.Linq.Core.DocTypeBase.#ctor">
<summary>
Initializes a new instance of the <see cref="T:umbraco.Linq.Core.DocTypeBase"/> class.
</summary>
</member>
<member name="M:umbraco.Linq.Core.DocTypeBase.ChildrenOfType``1">
<summary>
Gets the children which are of the type TDocTypeBase.
</summary>
<typeparam name="TDocTypeBase">The DocType of the children desired.</typeparam>
<returns>An <see cref="T:umbraco.Linq.Core.AssociationTree`1"/> of the children</returns>
</member>
<member name="M:umbraco.Linq.Core.DocTypeBase.Parent``1">
<summary>
Parent this instance.
</summary>
<typeparam name="TParent">The type of the parent.</typeparam>
<returns>Null when at the root level, else the parent instance</returns>
<exception cref="T:umbraco.Linq.Core.DocTypeMissMatchException">If the type of the parent does not match the provided type</exception>
</member>
<member name="M:umbraco.Linq.Core.DocTypeBase.AncestorOrDefault``1">
<summary>
Retrieves the first matching ancestor of the current type
</summary>
<remarks>
Provides similar functionality to the XPath method
</remarks>
<returns>First ancestor matching type. Null if no match found</returns>
</member>
<member name="M:umbraco.Linq.Core.DocTypeBase.AncestorOrDefault``1(System.Func{``0,System.Boolean})">
<summary>
Retrieves the first matching ancestor of the current type and additional boolean function
</summary>
<typeparam name="TDocType">The type of the doc type.</typeparam>
<param name="func">Additional boolean operation to filter on</param>
<returns>First ancestor matching type and function. Null if no match found</returns>
<exception cref="T:System.ArgumentNullException">Func parameter required</exception>
</member>
<member name="M:umbraco.Linq.Core.DocTypeBase.RaisePropertyChanging">
<summary>
Raises the property changing event.
</summary>
</member>
<member name="M:umbraco.Linq.Core.DocTypeBase.RaisePropertyChanged(System.String)">
<summary>
Raises the property changed event.
</summary>
<param name="name">The name of the changed property.</param>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.IsDirty">
<summary>
Gets or sets a value indicating whether this instance has been modified since it was first loaded
</summary>
<value><c>true</c> if this instance has been modified; otherwise, <c>false</c>.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.Id">
<summary>
Gets or sets the id of the umbraco item
</summary>
<value>The id.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.Name">
<summary>
Gets or sets the name (title) of the umbraco item
</summary>
<value>The name.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.Version">
<summary>
Gets or sets the version of the umbraco item
</summary>
<value>The version.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.ParentNodeId">
<summary>
Gets or sets the ID of the parent node.
</summary>
<value>The parent node id.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.CreateDate">
<summary>
Gets or sets the created date.
</summary>
<value>The create date.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.SortOrder">
<summary>
Gets or sets the sort order.
</summary>
<value>The sort order.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.UpdateDate">
<summary>
Gets or sets the last updated date of the current version
</summary>
<value>The update date.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.Level">
<summary>
Gets or sets the level of this item in the content tree
</summary>
<value>The level.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.Children">
<summary>
Gets the children of this DocType instance.
</summary>
<value>The children of this DocType instance.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.Creator">
<summary>
Gets the umbraco user who created the item
</summary>
<value>The creator.</value>
</member>
<member name="P:umbraco.Linq.Core.DocTypeBase.Writer">
<summary>
Gets the umbraco user who last edited the instance
</summary>
<value>The writer.</value>
</member>
<member name="E:umbraco.Linq.Core.DocTypeBase.PropertyChanging">
<summary>
Occurs when a property value is changing.
</summary>
</member>
<member name="E:umbraco.Linq.Core.DocTypeBase.PropertyChanged">
<summary>
Occurs when a property value changes.
</summary>
</member>