C# Класс LayoutControls.UserSettings.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."

Наследование: System.Configuration.ApplicationSettingsBase
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
m_bItemCalled System.Boolean
m_bUseWorkbookSettings System.Boolean

Открытые методы

Метод Описание
NodeXLApplicationSettingsBase ( ) : System
NodeXLApplicationSettingsBase ( System.Boolean useWorkbookSettings ) : System
NotUseWorkbookSettings ( ) : void
OnNewWorkbook ( ) : void
Reset ( ) : void
Save ( ) : void
this ( String propertyName ) : Object

Защищенные методы

Метод Описание
CopyAndFilterSettings ( String sSourceSettings, String sDestinationSettings ) : String
CreateStandardSettingsFolder ( System.Boolean bAlsoCreateStandardSettingsFile ) : void
FileIsLocked ( IOException oIOException ) : System.Boolean

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

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

Приватные методы

Метод Описание
AssertValid ( ) : void

Описание методов

CopyAndFilterSettings() защищенный Метод

protected CopyAndFilterSettings ( String sSourceSettings, String sDestinationSettings ) : String
sSourceSettings String
sDestinationSettings String
Результат String

CreateStandardSettingsFolder() защищенный Метод

protected CreateStandardSettingsFolder ( System.Boolean bAlsoCreateStandardSettingsFile ) : void
bAlsoCreateStandardSettingsFile System.Boolean
Результат void

FileIsLocked() защищенный Метод

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. ///
Результат System.Boolean

GetStandardSettingsFilePath() защищенный статический Метод

protected static GetStandardSettingsFilePath ( ) : String
Результат String

GetStandardSettingsFileStream() защищенный Метод

protected GetStandardSettingsFileStream ( System.Boolean bForWriting ) : FileStream
bForWriting System.Boolean
Результат System.IO.FileStream

NodeXLApplicationSettingsBase() публичный Метод

public NodeXLApplicationSettingsBase ( ) : System
Результат System

NodeXLApplicationSettingsBase() публичный Метод

public NodeXLApplicationSettingsBase ( System.Boolean useWorkbookSettings ) : System
useWorkbookSettings System.Boolean
Результат System

NotUseWorkbookSettings() публичный Метод

public NotUseWorkbookSettings ( ) : void
Результат void

OnNewWorkbook() публичный Метод

public OnNewWorkbook ( ) : void
Результат void

OnSettingsLoaded() защищенный Метод

protected OnSettingsLoaded ( Object sender, System.Configuration.SettingsLoadedEventArgs e ) : void
sender Object
e System.Configuration.SettingsLoadedEventArgs
Результат void

ReadStandardSettingsFile() защищенный Метод

protected ReadStandardSettingsFile ( ) : String
Результат String

Reset() публичный Метод

public Reset ( ) : void
Результат void

Save() публичный Метод

public Save ( ) : void
Результат void

WriteStandardSettingsFile() защищенный Метод

protected WriteStandardSettingsFile ( String sFileContents ) : void
sFileContents String
Результат void

this() публичный Метод

public this ( String propertyName ) : Object
propertyName String
Результат Object

Описание свойств

m_bItemCalled защищенное свойство

protected Boolean,System m_bItemCalled
Результат System.Boolean

m_bUseWorkbookSettings защищенное свойство

protected Boolean,System m_bUseWorkbookSettings
Результат System.Boolean