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< SdiMainForm > | TopLevelForms [get] |
Property that returns the list of top level forms. |
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.
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.
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.
type | The type of the main form. |
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.
name | The name to be used to retrieve this view. | |
type | The type of the class that for this view. |
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.
type | The type of the document class. |
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.
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. |
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.
key | The name of the view to retrieve. | |
type | The type of the view to retrieve. | |
container | The container that contains the view. |
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.
container | The container that contains the active view. |
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.