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
Datei anzeigen Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Property Type Description
m_bItemCalled System.Boolean
m_bUseWorkbookSettings System.Boolean

Public Methods

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

Protected Methods

Method 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

Method Description
AssertValid ( ) : void

Method Details

CopyAndFilterSettings() protected method

protected CopyAndFilterSettings ( String sSourceSettings, String sDestinationSettings ) : String
sSourceSettings String
sDestinationSettings String
return String

CopyStandardSettingsToWorkbookSettings() protected method

protected CopyStandardSettingsToWorkbookSettings ( ) : void
return void

CopyWorkbookSettingsToStandardSettings() protected method

protected CopyWorkbookSettingsToStandardSettings ( ) : void
return void

CreateStandardSettingsFolder() protected method

protected CreateStandardSettingsFolder ( System.Boolean bAlsoCreateStandardSettingsFile ) : void
bAlsoCreateStandardSettingsFile System.Boolean
return void

FileIsLocked() protected method

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. ///
return System.Boolean

GetPerWorkbookSettings() protected method

protected GetPerWorkbookSettings ( ) : PerWorkbookSettings
return PerWorkbookSettings

GetStandardSettingsFilePath() protected static method

protected static GetStandardSettingsFilePath ( ) : String
return String

GetStandardSettingsFileStream() protected method

protected GetStandardSettingsFileStream ( System.Boolean bForWriting ) : FileStream
bForWriting System.Boolean
return System.IO.FileStream

GetWorkbookSettings() protected method

protected GetWorkbookSettings ( ) : String
return String

NodeXLApplicationSettingsBase() public method

public NodeXLApplicationSettingsBase ( ) : System
return System

NodeXLApplicationSettingsBase() public method

public NodeXLApplicationSettingsBase ( System.Boolean useWorkbookSettings ) : System
useWorkbookSettings System.Boolean
return System

NotUseWorkbookSettings() public method

public NotUseWorkbookSettings ( ) : void
return void

OnNewWorkbook() public method

public OnNewWorkbook ( ) : void
return void

OnSettingsLoaded() protected method

protected OnSettingsLoaded ( Object sender, System.Configuration.SettingsLoadedEventArgs e ) : void
sender Object
e System.Configuration.SettingsLoadedEventArgs
return void

ReadStandardSettingsFile() protected method

protected ReadStandardSettingsFile ( ) : String
return String

Reset() public method

public Reset ( ) : void
return void

Save() public method

public Save ( ) : void
return void

SetWorkbookSettings() protected method

protected SetWorkbookSettings ( String sWorkbookSettings ) : void
sWorkbookSettings String
return void

UseNewWorkbookSettingsForThisWorkbook() public method

public UseNewWorkbookSettingsForThisWorkbook ( ) : void
return void

UseWorkbookSettingsForNewWorkbooks() public method

public UseWorkbookSettingsForNewWorkbooks ( ) : void
return void

WriteStandardSettingsFile() protected method

protected WriteStandardSettingsFile ( String sFileContents ) : void
sFileContents String
return void

this() public method

public this ( String propertyName ) : Object
propertyName String
return Object

Property Details

m_bItemCalled protected_oe property

protected Boolean,System m_bItemCalled
return System.Boolean

m_bUseWorkbookSettings protected_oe property

protected Boolean,System m_bUseWorkbookSettings
return System.Boolean