메소드 | 설명 | |
---|---|---|
Clone ( ) : object |
Retrieves a copy of itself. This method needs to be implemented by derived classes. |
|
CloneReadOnly ( ) : IReadOnlyProfile |
Retrieves a copy of itself and makes it read-only. This method serves as a convenient way to pass a read-only copy of the profile to methods that are not allowed to modify it. |
|
GetDataSet ( ) : |
Retrieves a DataSet object containing every section, entry, and value in the profile. The returned DataSet will be named using the Name property. It will contain one table for each section, and each entry will be represented by a column inside the table. Each table will contain only one row where the values will stored corresponding to each column (entry). This method serves as a convenient way to extract the profile's data to this generic medium known as the DataSet. This allows it to be moved to many different places, including a different type of profile object (eg., INI to XML conversion). This method calls GetSectionNames, GetEntryNames, and GetValue of the derived class, so check the documentation to see what other exceptions may be raised. |
|
GetEntryNames ( string section ) : string[] |
Retrieves the names of all the entries inside a section. This method needs to be implemented by derived classes. Check the documentation to see what other exceptions derived versions may raise. |
|
GetSectionNames ( ) : string[] |
Retrieves the names of all the sections. This method needs to be implemented by derived classes. Check the documentation to see what exceptions derived versions may raise. |
|
GetValue ( string section, string entry, bool defaultValue ) : bool |
Retrieves the bool value of an entry inside a section, or a default value if the entry does not exist. Note: Boolean values are stored as "True" or "False". This method calls |
|
GetValue ( string section, string entry, double defaultValue ) : double |
Retrieves the double value of an entry inside a section, or a default value if the entry does not exist. This method calls |
|
GetValue ( string section, string entry, int defaultValue ) : int |
Retrieves the integer value of an entry inside a section, or a default value if the entry does not exist. This method calls |
|
GetValue ( string section, string entry ) : object |
Retrieves the value of an entry inside a section. This method needs to be implemented by derived classes. Check the documentation to see what other exceptions derived versions may raise. |
|
GetValue ( string section, string entry, string defaultValue ) : string |
Retrieves the string value of an entry inside a section, or a default value if the entry does not exist. This method calls |
|
HasEntry ( string section, string entry ) : bool |
Determines if an entry exists inside a section. This method calls GetEntryNames of the derived class, so check its documentation to see what other exceptions may be raised. |
|
HasSection ( string section ) : bool |
Determines if a section exists.
|
|
RemoveEntry ( string section, string entry ) : void |
Removes an entry from a section. This method needs to be implemented by derived classes. Check the documentation to see what other exceptions derived versions may raise. See |
|
RemoveSection ( string section ) : void |
Removes a section. This method needs to be implemented by derived classes. Check the documentation to see what other exceptions derived versions may raise. See |
|
SetDataSet ( |
Writes the data of every table from a DataSet into this profile. Each table in the DataSet represents a section of the profile. Each column of each table represents an entry. And for each column, the corresponding value of the first row is the value to be passed to SetValue. Note that only the first row is imported; additional rows are ignored. This method serves as a convenient way to take any data inside a generic DataSet and write it to any of the available profiles. This method calls SetValue of the derived class, so check its documentation to see what other exceptions may be raised. |
|
SetValue ( string section, string entry, object value ) : void |
Sets the value for an entry inside a section. This method needs to be implemented by derived classes. Check the documentation to see what other exceptions derived versions may raise. See |
메소드 | 설명 | |
---|---|---|
OnChanged ( |
Raises the Changed event. This method should be invoked after a change to the profile has been made so that the Changed event is raised, giving a chance to the handlers to be notified of the change. |
|
OnChanging ( |
Raises the Changing event. This method should be invoked prior to making a change to the profile so that the Changing event is raised, giving a chance to the handlers to prevent the change from happening (by setting e.Cancel to true). This method calls each individual handler associated with the Changing event and checks the resulting e.Cancel flag. If it's true, it stops and does not call of any remaining handlers since the change needs to be prevented anyway. |
|
Profile ( ) : System |
Initializes a new instance of the Profile class by setting the Name to DefaultName.
|
|
Profile ( |
Initializes a new instance of the Profile class based on another Profile object.
|
|
Profile ( string name ) : System |
Initializes a new instance of the Profile class by setting the Name to a value.
|
|
RaiseChangeEvent ( bool changing, ProfileChangeType changeType, string section, string entry, object value ) : bool |
Raises either the Changing or Changed event. This method may be used by derived classes as a convenient alternative to calling OnChanging and OnChanged. For example, a typical call to OnChanging would require four lines of code, which this method reduces to two. |
|
VerifyAndAdjustEntry ( string &entry ) : void |
Verifies the given entry name is not null and trims it. This method may be used by derived classes to make sure that a valid entry name has been passed, and to make any necessary adjustments to it before passing it to the corresponding APIs. |
|
VerifyAndAdjustSection ( string §ion ) : void |
Verifies the given section name is not null and trims it. This method may be used by derived classes to make sure that a valid section name has been passed, and to make any necessary adjustments to it before passing it to the corresponding APIs. |
|
VerifyName ( ) : void |
Verifies the Name property is not empty or null. This method may be used by derived classes to make sure that the APIs are working with a valid Name (file name) |
|
VerifyNotReadOnly ( ) : void |
Verifies the ReadOnly property is not true. This method may be used by derived classes as a convenient way to validate that modifications to the profile can be made. |
public abstract GetEntryNames ( string section ) : string[] | ||
section | string | /// The name of the section holding the entries. |
리턴 | string[] |
public GetValue ( string section, string entry, bool defaultValue ) : bool | ||
section | string | /// The name of the section that holds the entry with the value. |
entry | string | /// The name of the entry where the value is stored. |
defaultValue | bool | /// The value to return if the entry (or section) does not exist. |
리턴 | bool |
public GetValue ( string section, string entry, double defaultValue ) : double | ||
section | string | /// The name of the section that holds the entry with the value. |
entry | string | /// The name of the entry where the value is stored. |
defaultValue | double | /// The value to return if the entry (or section) does not exist. |
리턴 | double |
public GetValue ( string section, string entry, int defaultValue ) : int | ||
section | string | /// The name of the section that holds the entry with the value. |
entry | string | /// The name of the entry where the value is stored. |
defaultValue | int | /// The value to return if the entry (or section) does not exist. |
리턴 | int |
public abstract GetValue ( string section, string entry ) : object | ||
section | string | /// The name of the section that holds the entry with the value. |
entry | string | /// The name of the entry where the value is stored. |
리턴 | object |
public GetValue ( string section, string entry, string defaultValue ) : string | ||
section | string | /// The name of the section that holds the entry with the value. |
entry | string | /// The name of the entry where the value is stored. |
defaultValue | string | /// The value to return if the entry (or section) does not exist. |
리턴 | string |
public HasEntry ( string section, string entry ) : bool | ||
section | string | /// The name of the section that holds the entry. |
entry | string | /// The name of the entry to be checked for existence. |
리턴 | bool |
public HasSection ( string section ) : bool | ||
section | string | /// The name of the section to be checked for existence. |
리턴 | bool |
protected OnChanged ( |
||
e | /// The arguments object associated with the Changed event. | |
리턴 | void |
protected OnChanging ( |
||
e | /// The arguments object associated with the Changing event. | |
리턴 | void |
protected Profile ( string name ) : System | ||
name | string |
/// The name to initialize the |
리턴 | System |
protected RaiseChangeEvent ( bool changing, ProfileChangeType changeType, string section, string entry, object value ) : bool | ||
changing | bool | /// If true, the Changing event is raised otherwise it's Changed. |
changeType | ProfileChangeType | /// The type of change being made. |
section | string | /// The name of the section that was involved in the change or null if not applicable. |
entry | string | /// The name of the entry that was involved in the change or null if not applicable. /// If changeType is equal to Other, entry is the name of the property involved in the change. |
value | object | /// The value that was changed or null if not applicable. |
리턴 | bool |
public abstract RemoveEntry ( string section, string entry ) : void | ||
section | string | /// The name of the section that holds the entry. |
entry | string | /// The name of the entry to remove. |
리턴 | void |
public abstract RemoveSection ( string section ) : void | ||
section | string | /// The name of the section to remove. |
리턴 | void |
public SetDataSet ( |
||
ds | /// The DataSet object containing the data to be set. | |
리턴 | void |
public abstract SetValue ( string section, string entry, object value ) : void | ||
section | string | /// The name of the section that holds the entry. |
entry | string | /// The name of the entry where the value will be set. |
value | object | /// The value to set. If it's null, the entry should be removed. |
리턴 | void |
protected VerifyAndAdjustEntry ( string &entry ) : void | ||
entry | string | /// The entry name to verify and adjust. |
리턴 | void |
protected VerifyAndAdjustSection ( string §ion ) : void | ||
section | string | /// The section name to verify and adjust. |
리턴 | void |