C# Class Smrf.AppLib.SaveFileDialog2

Represents a smart SaveFileDialog that knows how to get a file name from the user and save an object to the file. Abstract.
This is an abstract base class. Each class derived from this one is responsible for saving one type of object, such as an image or an XML document. A derived class must implement GetDialogTitle(), GetFilter(), and SaveObject(). It should also implement a public method called ShowDialogAndSaveXXX(), where XXX is Image or XML, for example. ShowDialogAndSaveXXX() should call ShowDialogAndSaveObject() in this base class to do most of the work.
Afficher le fichier Open project: 2014-sed-team3/term-project

Protected Properties

Свойство Type Description
m_oSaveFileDialog System.Windows.Forms.SaveFileDialog

Méthodes publiques

Méthode Description
SaveFileDialog2 ( String sInitialDirectory, String sInitialFileName ) : System

Initializes a new instance of the SaveFileDialog2 class.

Méthodes protégées

Méthode Description
GetDialogTitle ( Object oObjectBeingSaved ) : String
GetFilter ( ) : String
GetInitialFilterIndex ( ) : Int32
GetNameOfFileToSave ( ) : String
OnSaveError ( String sErrorDescription ) : void
SaveObject ( Object oObject, String sFileName ) : void
ShowDialogAndSaveObject ( Object oObject ) : DialogResult

Private Methods

Méthode Description
AssertValid ( ) : void

Method Details

GetDialogTitle() protected abstract méthode

protected abstract GetDialogTitle ( Object oObjectBeingSaved ) : String
oObjectBeingSaved Object
Résultat String

GetFilter() protected abstract méthode

protected abstract GetFilter ( ) : String
Résultat String

GetInitialFilterIndex() protected méthode

protected GetInitialFilterIndex ( ) : Int32
Résultat System.Int32

GetNameOfFileToSave() protected méthode

protected GetNameOfFileToSave ( ) : String
Résultat String

OnSaveError() protected méthode

protected OnSaveError ( String sErrorDescription ) : void
sErrorDescription String
Résultat void

SaveFileDialog2() public méthode

Initializes a new instance of the SaveFileDialog2 class.
public SaveFileDialog2 ( String sInitialDirectory, String sInitialFileName ) : System
sInitialDirectory String /// Initial directory the dialog will display. Use an empty string to let /// the dialog select an initial directory. ///
sInitialFileName String /// Initial file name. Can be a complete path, a path without an /// extension, a file name, or a file name without an extension. ///
Résultat System

SaveObject() protected abstract méthode

protected abstract SaveObject ( Object oObject, String sFileName ) : void
oObject Object
sFileName String
Résultat void

ShowDialogAndSaveObject() protected méthode

protected ShowDialogAndSaveObject ( Object oObject ) : DialogResult
oObject Object
Résultat DialogResult

Property Details

m_oSaveFileDialog protected_oe property

protected SaveFileDialog,System.Windows.Forms m_oSaveFileDialog
Résultat System.Windows.Forms.SaveFileDialog