C# Class App_Code.Controls.WidgetContainer

Themeable class for displaying WidgetBase derived controls.
WidgetContainer is meant to be the themeable parent class of any control that derives from WidgetBase. This way a theme can automatically apply some basic styling to the way widgets are displayed without having to edit each one or edit the WidgetBase class to change the rendered output. Inherited WidgetContainers must contain a control named phWidgetBody. This is the control that the WidgetContainer's child Widget is injected inside of. phWidgetBody just needs to derive from Control to work, leaving flexibility for anyone creating a theme. If phWidgetBody isn't found, an exception isn't thrown, but a warning label is applied to the page.
Inheritance: System.Web.UI.UserControl
Show file Open project: rasmuskl/ReSharperCourse Class Usage Examples

Public Methods

Method Description
DoesThemeWidgetContainerExist ( bool existenceCheck ) : bool

Returns whether the theme contains a widget container file.

GetThemeWidgetContainerFilePath ( bool existenceCheck ) : string

Returns the file path of where a theme's widget container would expect to be located.

GetThemeWidgetContainerVirtualPath ( bool existenceCheck ) : string

Returns the virtual path of where a theme's widget container would expect to be located.

GetWidgetContainer ( App_Code.Controls.WidgetBase widgetControl ) : WidgetContainer

Loads the widget container (either the one located in the theme folder, or the default one if a theme widget container is missing), and adds the Widget to the widget container.

GetWidgetContainer ( App_Code.Controls.WidgetBase widgetControl, bool widgetContainerExists, string widgetContainerVirtualPath ) : WidgetContainer

Loads the widget container (either the one located in the theme folder, or the default one if a theme widget container is missing), and adds the Widget to the widget container.

ProcessLoad ( ) : void

Manually run the Initialization process.

RenderContainer ( ) : void

The container will be processed when invoked, rather than waiting for the Load event to occur.

Protected Methods

Method Description
OnLoad ( EventArgs e ) : void

Raises the E:System.Web.UI.Control.Load event.

OnPreRender ( EventArgs e ) : void

Raises the E:System.Web.UI.Control.PreRender event.

Method Details

DoesThemeWidgetContainerExist() public static method

Returns whether the theme contains a widget container file.
public static DoesThemeWidgetContainerExist ( bool existenceCheck ) : bool
existenceCheck bool
return bool

GetThemeWidgetContainerFilePath() public static method

Returns the file path of where a theme's widget container would expect to be located.
public static GetThemeWidgetContainerFilePath ( bool existenceCheck ) : string
existenceCheck bool
return string

GetThemeWidgetContainerVirtualPath() public static method

Returns the virtual path of where a theme's widget container would expect to be located.
public static GetThemeWidgetContainerVirtualPath ( bool existenceCheck ) : string
existenceCheck bool /// When true, the path to the theme folder to check for the WidgetContainer existence /// is returned. When false, the path to the control that will be loaded is returned. /// If it's a Razor theme, the path will be RazorHost instead of the actual theme folder /// name. ///
return string

GetWidgetContainer() public static method

Loads the widget container (either the one located in the theme folder, or the default one if a theme widget container is missing), and adds the Widget to the widget container.
public static GetWidgetContainer ( App_Code.Controls.WidgetBase widgetControl ) : WidgetContainer
widgetControl App_Code.Controls.WidgetBase
return WidgetContainer

GetWidgetContainer() public static method

Loads the widget container (either the one located in the theme folder, or the default one if a theme widget container is missing), and adds the Widget to the widget container.
public static GetWidgetContainer ( App_Code.Controls.WidgetBase widgetControl, bool widgetContainerExists, string widgetContainerVirtualPath ) : WidgetContainer
widgetControl App_Code.Controls.WidgetBase
widgetContainerExists bool
widgetContainerVirtualPath string
return WidgetContainer

OnLoad() protected method

Raises the E:System.Web.UI.Control.Load event.
protected OnLoad ( EventArgs e ) : void
e System.EventArgs The object that contains the event data.
return void

OnPreRender() protected method

Raises the E:System.Web.UI.Control.PreRender event.
protected OnPreRender ( EventArgs e ) : void
e System.EventArgs An object that contains the event data.
return void

ProcessLoad() public method

Manually run the Initialization process.
public ProcessLoad ( ) : void
return void

RenderContainer() public method

The container will be processed when invoked, rather than waiting for the Load event to occur.
public RenderContainer ( ) : void
return void