C# Class Support.UI.AbstractDirtyForm

Handles Form "dirty/clean" states in relation to file loading / saving. Acts as an abstract class, but is not. (forms & abstraction break the IDE in MSVS2003) Be sure to override SaveFormData and OpenFormData
Inheritance: System.Windows.Forms.Form
Exibir arquivo Open project: nhmkdev/cardmaker

Protected Properties

Property Type Description
m_sBaseTitle string
m_sFileOpenFilter string
m_sLoadedFile string

Public Methods

Method Description
MarkClean ( ) : void

Marks this form as clean (save not needed)

MarkDirty ( ) : void

Marks this form as dirty (needing save)

Protected Methods

Method Description
InitNew ( ) : void

Initializes a simple new file

InitOpen ( string sFileName ) : bool

Initializes the open process with the file specified.

InitOpen ( ) : void

Initializes the Open process via the OpenFileDialog

InitSave ( bool bForceSaveAs ) : void

Initializes the Save / Save As dialog

OpenFormData ( string sFileName ) : bool

This method should have an override that performs the load of the data from the file.

SaveFormData ( string sFileName ) : bool

This method should have an override that performs the save of the data to the file.

SaveOnClose ( CancelEventArgs eArg ) : void

Event to associate with the OnClose event of the form

SaveOnEvent ( CancelEventArgs eArg, bool bAllowCancel ) : void
SetLoadedFile ( string sFileName ) : void

Sets the currently loaded file and marks the state as clean

Private Methods

Method Description
GetDialogDirectory ( ) : string

Gets the current directory associated with the form

Method Details

InitNew() protected method

Initializes a simple new file
protected InitNew ( ) : void
return void

InitOpen() protected method

Initializes the open process with the file specified.
protected InitOpen ( string sFileName ) : bool
sFileName string The file to open the data from
return bool

InitOpen() protected method

Initializes the Open process via the OpenFileDialog
protected InitOpen ( ) : void
return void

InitSave() protected method

Initializes the Save / Save As dialog
protected InitSave ( bool bForceSaveAs ) : void
bForceSaveAs bool
return void

MarkClean() public method

Marks this form as clean (save not needed)
public MarkClean ( ) : void
return void

MarkDirty() public method

Marks this form as dirty (needing save)
public MarkDirty ( ) : void
return void

OpenFormData() protected method

This method should have an override that performs the load of the data from the file.
protected OpenFormData ( string sFileName ) : bool
sFileName string The file to load the data from
return bool

SaveFormData() protected method

This method should have an override that performs the save of the data to the file.
protected SaveFormData ( string sFileName ) : bool
sFileName string The file to save the data to
return bool

SaveOnClose() protected method

Event to associate with the OnClose event of the form
protected SaveOnClose ( CancelEventArgs eArg ) : void
eArg CancelEventArgs
return void

SaveOnEvent() protected method

protected SaveOnEvent ( CancelEventArgs eArg, bool bAllowCancel ) : void
eArg CancelEventArgs
bAllowCancel bool
return void

SetLoadedFile() protected method

Sets the currently loaded file and marks the state as clean
protected SetLoadedFile ( string sFileName ) : void
sFileName string
return void

Property Details

m_sBaseTitle protected_oe property

protected string m_sBaseTitle
return string

m_sFileOpenFilter protected_oe property

protected string m_sFileOpenFilter
return string

m_sLoadedFile protected_oe property

protected string m_sLoadedFile
return string