SdiBaseSimple::SdiApplicationContext Class Reference

Collaboration diagram for SdiBaseSimple::SdiApplicationContext:
[legend]
List of all members.

Public Member Functions

 SdiApplicationContext ()
 Default Constructor.
void AddMainForm (SdiMainForm mainForm)
 Add a main form to the current context.
SdiMainForm CreateMainForm (Type type)
 Create a main form and add it to the context.
SdiDoc CreateDocument (Type type)
 Call this method from the main form of an Sdi application to create the document for the application.
SdiView SetView (String strViewName, Type type, Control control)
 Make a view active in a container.
SdiView GetView (String key, Type type, Control container)
 Retrieve a view by name.
SdiView GetActiveView (Control container)
 Returns the current view that is active in a container in the main form.

Protected Member Functions

SdiView CreateView (String name, Type type)
 Calls constructor of type, using reflection.

Properties

SdiDoc Doc [get, set]
 Property that returns the document, as SdiDoc.
List< SdiMainFormTopLevelForms [get]
 Property that returns the list of top level forms.

Detailed Description

Application context for Sdi application.
Call CreateDocument from main form of application.
Call SetView for each view to be added to main form.
The doc can be accessed through this context.
The active view can be accessed through this context.


Constructor & Destructor Documentation

SdiBaseSimple::SdiApplicationContext::SdiApplicationContext (  )  [inline]

Default Constructor.

The default constructor does not do anything, but it is safer to always create a default constructor: the designer calls them at the strangest times.


Member Function Documentation

void SdiBaseSimple::SdiApplicationContext::AddMainForm ( SdiMainForm  mainForm  )  [inline]

Add a main form to the current context.

This should be called from the constructor of the main form class.

Parameters:
mainForm The main form to add.

SdiMainForm SdiBaseSimple::SdiApplicationContext::CreateMainForm ( Type  type  )  [inline]

Create a main form and add it to the context.

Call this method when a main form that is already open needs to create another top level form.

Parameters:
type The type of the main form.
Returns:
The main form that was created.

SdiView SdiBaseSimple::SdiApplicationContext::CreateView ( String  name,
Type  type 
) [inline, protected]

Calls constructor of type, using reflection.

If a view has not been created, then it can be created in the base class using reflection. This saves the programmer from having to construct each view before adding it to a container.

Parameters:
name The name to be used to retrieve this view.
type The type of the class that for this view.
Returns:
Returns the view that is created as SdiView.

SdiDoc SdiBaseSimple::SdiApplicationContext::CreateDocument ( Type  type  )  [inline]

Call this method from the main form of an Sdi application to create the document for the application.

Parameters:
type The type of the document class.
Returns:
The document that was created, as SdiDoc.

SdiView SdiBaseSimple::SdiApplicationContext::SetView ( String  strViewName,
Type  type,
Control  control 
) [inline]

Make a view active in a container.

This will construct the view if it has not already been constructed.
Call it for each view that will be displayed.
This method will make this view active and hide the previous view.

Parameters:
strViewName The name used to retrieve the view.
type The type of the view class.
control The container control that the view should be added to.
Returns:
The view that was activated; returned as SdiView.

SdiView SdiBaseSimple::SdiApplicationContext::GetView ( String  key,
Type  type,
Control  container 
) [inline]

Retrieve a view by name.

Uses the name that was sent to the SetView method.

Parameters:
key The name of the view to retrieve.
type The type of the view to retrieve.
container The container that contains the view.
Returns:
The view; returned as SdiView.

SdiView SdiBaseSimple::SdiApplicationContext::GetActiveView ( Control  container  )  [inline]

Returns the current view that is active in a container in the main form.

Uses the name that was sent to the SetView method.

Parameters:
container The container that contains the active view.
Returns:
The view; returned as SdiView.


Property Documentation

SdiDoc SdiBaseSimple::SdiApplicationContext::Doc [get, set]

Property that returns the document, as SdiDoc.

List<SdiMainForm> SdiBaseSimple::SdiApplicationContext::TopLevelForms [get]

Property that returns the list of top level forms.


The documentation for this class was generated from the following file:
Generated on Thu Nov 9 12:19:37 2006 for test by  doxygen 1.5.1-p1