C# Class SenseNet.Portal.UI.ContentView

ContentView is a class responsible for enabling various visualizations of the Content class that it owns.
The two most important properties of ContentView is the collection of FieldControls and the Content it references. These two parts are closely related as every FieldControl wraps a #Field# defined within its Content. Basically the ContentView is a visualizer of the Content assigned to it when created. The FieldControls of this ContentView each visualize a #Field# defined within this Content (but not necessary all of them). Another important role of the ContentView is automatically utilizing the pre-defined ViewModes It renders itself and all of its FieldControls according to the ViewMode assigned to it when created.
Inheritance: System.Web.UI.UserControl, INamingContainer
ファイルを表示 Open project: maxpavlov/FlexNet Class Usage Examples

Private Properties

Property Type Description
AddContentViewToCache void
CreateFromActualPath ContentView
CreateFromViewRoot ContentView
GetContentViewFromCache ContentView
GetDefaultControlRenderMode FieldControlRenderMode
GetGenericPath string
GetIndexedFieldValue int
GetProperty string
GetString string
GetString string
GetTypeDependentPath string
GetValue string
GetValue string
Initialize void
RegisterControl ContentView
RegisterErrorControl void
RegisterFieldControl void
ResolveContentViewPath string
SetContentViewFieldError void
SetFieldInControl void

Public Methods

Method Description
Create ( SenseNet.ContentRepository content, System aspNetPage, ViewMode mode ) : ContentView

Creates the ContenView for the Content.

Create ( SenseNet.ContentRepository content, System aspNetPage, ViewMode mode, string viewPath ) : ContentView

Creates the ContenView for the Content.

OnCommandButtonsAction ( object sender, CommandButtonType commandButtonType, bool &cancelled ) : void
OnCommandButtonsAction ( object sender, CommandButtonType commandButtonType, string customCommand, bool &cancelled ) : void
OnCommandButtonsAction ( object sender, string customCommand, bool &cancelled ) : void
OnUserAction ( object sender, string actionName, string eventName ) : void

Fires all EventHandlers registered for UserAction.

UpdateContent ( ) : void

Updates and validates data of FieldControls owned by this ContentView

UpdateContent ( bool withValidate ) : void

Updates data of FieldControls owned by this ContentView

Protected Methods

Method Description
CallDone ( ) : void
CallDone ( bool endResponse ) : void
GetValue ( string name ) : string
IsIndexedField ( string text ) : bool
OnViewInitialize ( ) : void
Render ( System.Web.UI.HtmlTextWriter writer ) : void

Renders the view.

Should an error occur (ContentException being set) and there are no error controls registered then the error message will rendered in the top of the view. Otherwise errors (if any) are viewed within the registered error control(s).

StripIndex ( string text ) : string

Private Methods

Method Description
AddContentViewToCache ( string path, ContentView contentView ) : void
CreateFromActualPath ( SenseNet.ContentRepository content, System aspNetPage, ViewMode viewMode, string viewPath ) : ContentView
CreateFromViewRoot ( SenseNet.ContentRepository content, System aspNetPage, ViewMode mode, string viewRoot ) : ContentView
GetContentViewFromCache ( string path ) : ContentView
GetDefaultControlRenderMode ( ViewMode viewMode ) : FieldControlRenderMode
GetGenericPath ( SenseNet.ContentRepository content, ViewMode mode, string viewRoot ) : string
GetIndexedFieldValue ( string text ) : int
GetProperty ( string name ) : string
GetString ( string name ) : string
GetString ( string className, string name ) : string
GetTypeDependentPath ( SenseNet.ContentRepository content, ViewMode mode, string viewRoot ) : string
GetValue ( string name, SenseNet.ContentRepository parentContent ) : string
GetValue ( string name, SenseNet.ContentRepository parentContent, OutputMethod outputMethod ) : string

Gets a the specified property belonging to the Content of the View in a safe way.

Initialize ( SenseNet.ContentRepository content, ViewMode viewMode ) : void
RegisterControl ( ViewControlBase control ) : ContentView
RegisterErrorControl ( ErrorControl errorControl ) : void
RegisterFieldControl ( FieldControl fieldControl ) : void
ResolveContentViewPath ( SenseNet.ContentRepository content, ViewMode mode, string path ) : string
SetContentViewFieldError ( ) : void
SetFieldInControl ( FieldControl fieldControl ) : void

Method Details

CallDone() protected method

protected CallDone ( ) : void
return void

CallDone() protected method

protected CallDone ( bool endResponse ) : void
endResponse bool
return void

Create() public static method

Creates the ContenView for the Content.
public static Create ( SenseNet.ContentRepository content, System aspNetPage, ViewMode mode ) : ContentView
content SenseNet.ContentRepository The Content belonging to the the ContentView
aspNetPage System
mode ViewMode The ViewMode in which FieldControls of the ContentView will be rendered
return ContentView

Create() public static method

Creates the ContenView for the Content.
public static Create ( SenseNet.ContentRepository content, System aspNetPage, ViewMode mode, string viewPath ) : ContentView
content SenseNet.ContentRepository The Content belonging to the the ContentView
aspNetPage System
mode ViewMode The ViewMode in which FieldControls of the ContentView will be rendered
viewPath string The location of the file defining the ContentView
return ContentView

GetValue() protected method

protected GetValue ( string name ) : string
name string
return string

IsIndexedField() protected static method

protected static IsIndexedField ( string text ) : bool
text string
return bool

OnCommandButtonsAction() public method

public OnCommandButtonsAction ( object sender, CommandButtonType commandButtonType, bool &cancelled ) : void
sender object
commandButtonType CommandButtonType
cancelled bool
return void

OnCommandButtonsAction() public method

public OnCommandButtonsAction ( object sender, CommandButtonType commandButtonType, string customCommand, bool &cancelled ) : void
sender object
commandButtonType CommandButtonType
customCommand string
cancelled bool
return void

OnCommandButtonsAction() public method

public OnCommandButtonsAction ( object sender, string customCommand, bool &cancelled ) : void
sender object
customCommand string
cancelled bool
return void

OnUserAction() public method

Fires all EventHandlers registered for UserAction.
public OnUserAction ( object sender, string actionName, string eventName ) : void
sender object Object from where the call is originating from
actionName string Name of the action needed to be handled
eventName string Name of the event needed to be handled
return void

OnViewInitialize() protected method

protected OnViewInitialize ( ) : void
return void

Render() protected method

Renders the view.
Should an error occur (ContentException being set) and there are no error controls registered then the error message will rendered in the top of the view. Otherwise errors (if any) are viewed within the registered error control(s).
protected Render ( System.Web.UI.HtmlTextWriter writer ) : void
writer System.Web.UI.HtmlTextWriter
return void

StripIndex() protected static method

protected static StripIndex ( string text ) : string
text string
return string

UpdateContent() public method

Updates and validates data of FieldControls owned by this ContentView
public UpdateContent ( ) : void
return void

UpdateContent() public method

Updates data of FieldControls owned by this ContentView
public UpdateContent ( bool withValidate ) : void
withValidate bool Whether the Updates data of Contents owned by this ContentView data should be validated after updating. When true content validation errors will be displayed (if any), when false, these errors will not be visible.
return void