C# Class Smrf.AppLib.OpenFileDialog2

Represents a smart OpenFileDialog that knows how to get a file name from the user and open an object from the file. Abstract.
This is an abstract base class. Each class derived from this one is responsible for opening one type of file and creating an object from the file contents. A file type might be an image or an XML document, for example. A derived class must implement GetDialogTitle(), GetFilter(), and OpenObject(). It should also implement a public method called ShowDialogAndOpenXXX(), where XXX is Image or XML, for example. ShowDialogAndOpenXXX() should call ShowDialogAndOpenObject() 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_oOpenFileDialog System.Windows.Forms.OpenFileDialog

Méthodes publiques

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

Initializes a new instance of the OpenFileDialog2 class.

Méthodes protégées

Méthode Description
GetDialogTitle ( ) : String
GetFilter ( ) : String
OnOpenError ( String sErrorDescription ) : void
OpenObject ( String sFileName, Object &oObject ) : void
ShowDialogAndOpenObject ( Object &oObject ) : DialogResult

Private Methods

Méthode Description
AssertValid ( ) : void

Method Details

GetDialogTitle() protected abstract méthode

protected abstract GetDialogTitle ( ) : String
Résultat String

GetFilter() protected abstract méthode

protected abstract GetFilter ( ) : String
Résultat String

OnOpenError() protected méthode

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

OpenFileDialog2() public méthode

Initializes a new instance of the OpenFileDialog2 class.
public OpenFileDialog2 ( 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

OpenObject() protected abstract méthode

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

ShowDialogAndOpenObject() protected méthode

protected ShowDialogAndOpenObject ( Object &oObject ) : DialogResult
oObject Object
Résultat DialogResult

Property Details

m_oOpenFileDialog protected_oe property

protected OpenFileDialog,System.Windows.Forms m_oOpenFileDialog
Résultat System.Windows.Forms.OpenFileDialog