C# Class Smrf.NodeXL.ExcelTemplate.NodeXLApplicationSettingsBase

Base class for most NodeXL's user settings classes.
This is the base class for all of NodeXL's user settings classes except those used to save dialog positions, which are derived from .

This class saves user settings to the workbook so that the settings travel with the workbook. It does this by intercepting calls to the property, the Save method, and the method. Within each intercept, the workbook settings are copied to the file that the base class uses to store settings, the base class is allowed to do its usual work on the file, and if appropriate, the file is then copied back to the workbook settings. The net result is that the base class effectively reads and writes the workbook settings. The actual file settings are used by NodeXL only when a new workbook is created.

This is much easier than creating a custom settings provider, which is not well documented and far from trivial. That's especially true when settings groups are used, as they are in NodeXL.

In this class, the file that the base class uses to store settings is called the "standard settings file", and the settings stored in the workbook are called the "workbook settings."

Inheritance: System.Configuration.ApplicationSettingsBase
Afficher le fichier Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Свойство Type Description
m_bItemCalled System.Boolean
m_bUseWorkbookSettings System.Boolean

Méthodes publiques

Méthode Description
NodeXLApplicationSettingsBase ( ) : System
NodeXLApplicationSettingsBase ( System.Boolean useWorkbookSettings ) : System
NotUseWorkbookSettings ( ) : void
OnNewWorkbook ( ) : void
Reset ( ) : void
Save ( ) : void
UseNewWorkbookSettingsForThisWorkbook ( ) : void
UseWorkbookSettingsForNewWorkbooks ( ) : void
this ( String propertyName ) : Object

Méthodes protégées

Méthode Description
CopyAndFilterSettings ( String sSourceSettings, String sDestinationSettings ) : String
CopyStandardSettingsToWorkbookSettings ( ) : void
CopyWorkbookSettingsToStandardSettings ( ) : void
CreateStandardSettingsFolder ( System.Boolean bAlsoCreateStandardSettingsFile ) : void
FileIsLocked ( IOException oIOException ) : System.Boolean

Determines whether an IOException was thrown because a file was locked.

GetPerWorkbookSettings ( ) : PerWorkbookSettings
GetStandardSettingsFilePath ( ) : String
GetStandardSettingsFileStream ( System.Boolean bForWriting ) : FileStream
GetWorkbookSettings ( ) : String
OnSettingsLoaded ( Object sender, System.Configuration.SettingsLoadedEventArgs e ) : void
ReadStandardSettingsFile ( ) : String
SetWorkbookSettings ( String sWorkbookSettings ) : void
WriteStandardSettingsFile ( String sFileContents ) : void

Private Methods

Méthode Description
AssertValid ( ) : void

Method Details

CopyAndFilterSettings() protected méthode

protected CopyAndFilterSettings ( String sSourceSettings, String sDestinationSettings ) : String
sSourceSettings String
sDestinationSettings String
Résultat String

CopyStandardSettingsToWorkbookSettings() protected méthode

protected CopyStandardSettingsToWorkbookSettings ( ) : void
Résultat void

CopyWorkbookSettingsToStandardSettings() protected méthode

protected CopyWorkbookSettingsToStandardSettings ( ) : void
Résultat void

CreateStandardSettingsFolder() protected méthode

protected CreateStandardSettingsFolder ( System.Boolean bAlsoCreateStandardSettingsFile ) : void
bAlsoCreateStandardSettingsFile System.Boolean
Résultat void

FileIsLocked() protected méthode

Determines whether an IOException was thrown because a file was locked.
protected FileIsLocked ( IOException oIOException ) : System.Boolean
oIOException System.IO.IOException /// The IOException that was thrown. ///
Résultat System.Boolean

GetPerWorkbookSettings() protected méthode

protected GetPerWorkbookSettings ( ) : PerWorkbookSettings
Résultat PerWorkbookSettings

GetStandardSettingsFilePath() protected static méthode

protected static GetStandardSettingsFilePath ( ) : String
Résultat String

GetStandardSettingsFileStream() protected méthode

protected GetStandardSettingsFileStream ( System.Boolean bForWriting ) : FileStream
bForWriting System.Boolean
Résultat System.IO.FileStream

GetWorkbookSettings() protected méthode

protected GetWorkbookSettings ( ) : String
Résultat String

NodeXLApplicationSettingsBase() public méthode

public NodeXLApplicationSettingsBase ( ) : System
Résultat System

NodeXLApplicationSettingsBase() public méthode

public NodeXLApplicationSettingsBase ( System.Boolean useWorkbookSettings ) : System
useWorkbookSettings System.Boolean
Résultat System

NotUseWorkbookSettings() public méthode

public NotUseWorkbookSettings ( ) : void
Résultat void

OnNewWorkbook() public méthode

public OnNewWorkbook ( ) : void
Résultat void

OnSettingsLoaded() protected méthode

protected OnSettingsLoaded ( Object sender, System.Configuration.SettingsLoadedEventArgs e ) : void
sender Object
e System.Configuration.SettingsLoadedEventArgs
Résultat void

ReadStandardSettingsFile() protected méthode

protected ReadStandardSettingsFile ( ) : String
Résultat String

Reset() public méthode

public Reset ( ) : void
Résultat void

Save() public méthode

public Save ( ) : void
Résultat void

SetWorkbookSettings() protected méthode

protected SetWorkbookSettings ( String sWorkbookSettings ) : void
sWorkbookSettings String
Résultat void

UseNewWorkbookSettingsForThisWorkbook() public méthode

public UseNewWorkbookSettingsForThisWorkbook ( ) : void
Résultat void

UseWorkbookSettingsForNewWorkbooks() public méthode

public UseWorkbookSettingsForNewWorkbooks ( ) : void
Résultat void

WriteStandardSettingsFile() protected méthode

protected WriteStandardSettingsFile ( String sFileContents ) : void
sFileContents String
Résultat void

this() public méthode

public this ( String propertyName ) : Object
propertyName String
Résultat Object

Property Details

m_bItemCalled protected_oe property

protected Boolean,System m_bItemCalled
Résultat System.Boolean

m_bUseWorkbookSettings protected_oe property

protected Boolean,System m_bUseWorkbookSettings
Résultat System.Boolean