C# Class Sphere.Core.IniFile

Represents an .ini format settings file.
Inheritance: IDisposable
Afficher le fichier Open project: Radnen/spherestudio

Méthodes publiques

Méthode 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 méthode

Releases any resources held by the INI object.
public Dispose ( ) : void
Résultat void

IniFile() public méthode

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. ///
Résultat System

Read() public méthode

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.
Résultat string

Save() public méthode

Saves the current values to the INI file.
public Save ( ) : bool
Résultat bool

SaveAs() public méthode

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.
Résultat bool

Write() public méthode

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.
Résultat void