C# Class Sphere.Core.IniFile

Represents an .ini format settings file.
Inheritance: IDisposable
Mostrar archivo Open project: Radnen/spherestudio

Public Methods

Method Description
Dispose ( ) : void

Releases any resources held by the INI object.

IniFile ( string filepath, bool autoSave = true ) : System

Constructs an IniFile object referencing the specified .ini file.

Read ( string section, string key, string defValue ) : string

Reads a string from the INI file.

Save ( ) : bool

Saves the current values to the INI file.

SaveAs ( string filepath ) : bool

Saves the current values to a specified INI file.

Write ( string section, string key, string value ) : void

Writes a string to the INI file.

Method Details

Dispose() public method

Releases any resources held by the INI object.
public Dispose ( ) : void
return void

IniFile() public method

Constructs an IniFile object referencing the specified .ini file.
public IniFile ( string filepath, bool autoSave = true ) : System
filepath string The fully qualified .ini file path.
autoSave bool /// Whether to save the file automatically after a value is written. If this is false, /// Save() must be called to persist the changes. ///
return System

Read() public method

Reads a string from the INI file.
public Read ( string section, string key, string defValue ) : string
section string The [section] to read from.
key string The name of the setting to read.
defValue string A default string to return if the key isn't found.
return string

Save() public method

Saves the current values to the INI file.
public Save ( ) : bool
return bool

SaveAs() public method

Saves the current values to a specified INI file.
public SaveAs ( string filepath ) : bool
filepath string The fully qualified path of the file to save.
return bool

Write() public method

Writes a string to the INI file.
public Write ( string section, string key, string value ) : void
section string The [section] to write.
key string The name of the setting to write.
value string The value of the setting.
return void