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
Afficher le fichier Open project: nhmkdev/cardmaker

Protected Properties

Свойство Type Description
m_sBaseTitle string
m_sFileOpenFilter string
m_sLoadedFile string

Méthodes publiques

Méthode Description
MarkClean ( ) : void

Marks this form as clean (save not needed)

MarkDirty ( ) : void

Marks this form as dirty (needing save)

Méthodes protégées

Méthode 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

Méthode Description
GetDialogDirectory ( ) : string

Gets the current directory associated with the form

Method Details

InitNew() protected méthode

Initializes a simple new file
protected InitNew ( ) : void
Résultat void

InitOpen() protected méthode

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

InitOpen() protected méthode

Initializes the Open process via the OpenFileDialog
protected InitOpen ( ) : void
Résultat void

InitSave() protected méthode

Initializes the Save / Save As dialog
protected InitSave ( bool bForceSaveAs ) : void
bForceSaveAs bool
Résultat void

MarkClean() public méthode

Marks this form as clean (save not needed)
public MarkClean ( ) : void
Résultat void

MarkDirty() public méthode

Marks this form as dirty (needing save)
public MarkDirty ( ) : void
Résultat void

OpenFormData() protected méthode

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
Résultat bool

SaveFormData() protected méthode

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
Résultat bool

SaveOnClose() protected méthode

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

SaveOnEvent() protected méthode

protected SaveOnEvent ( CancelEventArgs eArg, bool bAllowCancel ) : void
eArg CancelEventArgs
bAllowCancel bool
Résultat void

SetLoadedFile() protected méthode

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

Property Details

m_sBaseTitle protected_oe property

protected string m_sBaseTitle
Résultat string

m_sFileOpenFilter protected_oe property

protected string m_sFileOpenFilter
Résultat string

m_sLoadedFile protected_oe property

protected string m_sLoadedFile
Résultat string