SdiBaseSimple::SdiDoc Class Reference

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

Public Member Functions

 SdiDoc (SdiApplicationContext context)
 Each derived class MUST create a constructor with this signature and call the base class constructor.
virtual void DeleteContents ()
 Override this method in the extended doc to reset content.
void UpdateAllViews (Object sender)
 Call this method everytime the document changes.

Public Attributes

event UpdateEvent Update
 Each view is subscribed to this event.

Properties

bool Modified [get, set]
 A property that can be used to keep track if the document has changed.
SdiApplicationContext Context [get]
 Return the context for this application.

Detailed Description

Base class for document in Sdi application.

Base class for document in Sdi application.
There will be one doc for entire app.
Whenever the doc changes, call UpdateAllViews.
Override DeleteContents to reset extended class to initial state.
Set Modified whenever the doc changes. There is no built in functionality for Modified. All use of Modified must be implemented in extended class.


Constructor & Destructor Documentation

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

Each derived class MUST create a constructor with this signature and call the base class constructor.

            public ExtendedDoc(SdiApplicationContext context) : base(context) {}
            

Parameters:
context Pass the application context from the main form to this method.


Member Function Documentation

virtual void SdiBaseSimple::SdiDoc::DeleteContents (  )  [inline, virtual]

Override this method in the extended doc to reset content.

Each derived class will have its own data. Override this method to reset the data to its initial state.

Be sure to call the base class UpdateAllViews in the overridden method or call it directly in the overridden method.

void SdiBaseSimple::SdiDoc::UpdateAllViews ( Object  sender  )  [inline]

Call this method everytime the document changes.

This method will fire the Update event. All views that have been created with SdiApplicationContext.SetView will be notified of this event.

Parameters:
sender If the sender is not null, then it should be the current, active view. The Update handler in that view can test the parameter to see if it is the view that initiated the change. This is useful if the view already updated itself, before the document was notified of the change.


Member Data Documentation

event UpdateEvent SdiBaseSimple::SdiDoc::Update

Each view is subscribed to this event.

As part of the Sdi framework, each view will subscribe to this event when the Application:SetView method is called.


Property Documentation

bool SdiBaseSimple::SdiDoc::Modified [get, set]

A property that can be used to keep track if the document has changed.

There is no built in functionality for this property. It is up to the user to set this whenever the document changes and to clear it when the document is new or has been saved.

SdiApplicationContext SdiBaseSimple::SdiDoc::Context [get]

Return the context for this application.

The context was created in the main form and sent to the doc when the doc was created.


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