C# 클래스 Framework.Profile

상속: IProfile
파일 보기 프로젝트 열기: CarlosX/DarkEmu 1 사용 예제들

공개 메소드들

메소드 설명
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 ( ) : DataSet

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(section, entry) of the derived class, so check its documentation to see what other exceptions may be raised.

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(section, entry) of the derived class, so check its documentation to see what other exceptions may be raised.

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(section, entry) of the derived class, so check its documentation to see what other exceptions may be raised.

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 GetValue(section, entry) of the derived class, so check its documentation to see what other exceptions may be raised.

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 IProfile.RemoveEntry for additional remarks.

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 IProfile.RemoveSection for additional remarks.

SetDataSet ( DataSet ds ) : void

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 IProfile.SetValue for additional remarks.

보호된 메소드들

메소드 설명
OnChanged ( ProfileChangedArgs e ) : void

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 ( ProfileChangingArgs e ) : void

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 ( Profile profil ) : System

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 &section ) : 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.

메소드 상세

Clone() 공개 추상적인 메소드

Retrieves a copy of itself.
This method needs to be implemented by derived classes.
public abstract Clone ( ) : object
리턴 object

CloneReadOnly() 공개 메소드

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.
public CloneReadOnly ( ) : IReadOnlyProfile
리턴 IReadOnlyProfile

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.

/// is null or empty.
public GetDataSet ( ) : DataSet
리턴 System.Data.DataSet

GetEntryNames() 공개 추상적인 메소드

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.
/// section is null.
public abstract GetEntryNames ( string section ) : string[]
section string /// The name of the section holding the entries.
리턴 string[]

GetSectionNames() 공개 추상적인 메소드

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.
public abstract GetSectionNames ( ) : string[]
리턴 string[]

GetValue() 공개 메소드

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(section, entry) of the derived class, so check its documentation to see what other exceptions may be raised.

/// is null or empty. /// Either section or entry is null.
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

GetValue() 공개 메소드

Retrieves the double value of an entry inside a section, or a default value if the entry does not exist.
This method calls GetValue(section, entry) of the derived class, so check its documentation to see what other exceptions may be raised.
/// is null or empty. /// Either section or entry is null.
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

GetValue() 공개 메소드

Retrieves the integer value of an entry inside a section, or a default value if the entry does not exist.
This method calls GetValue(section, entry) of the derived class, so check its documentation to see what other exceptions may be raised.
/// is null or empty. /// Either section or entry is null.
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

GetValue() 공개 추상적인 메소드

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.
/// is null or empty. /// Either section or entry is null.
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

GetValue() 공개 메소드

Retrieves the string value of an entry inside a section, or a default value if the entry does not exist.
This method calls GetValue(section, entry) of the derived class, so check its documentation to see what other exceptions may be raised.
/// is null or empty. /// Either section or entry is null.
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

HasEntry() 공개 메소드

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.
/// section is null.
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

HasSection() 공개 메소드

Determines if a section exists.
public HasSection ( string section ) : bool
section string /// The name of the section to be checked for existence.
리턴 bool

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.
protected OnChanged ( ProfileChangedArgs e ) : void
e ProfileChangedArgs /// The arguments object associated with the Changed event.
리턴 void

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.
protected OnChanging ( ProfileChangingArgs e ) : void
e ProfileChangingArgs /// The arguments object associated with the Changing event.
리턴 void

Profile() 보호된 메소드

Initializes a new instance of the Profile class by setting the Name to DefaultName.
protected Profile ( ) : System
리턴 System

Profile() 보호된 메소드

Initializes a new instance of the Profile class based on another Profile object.
protected Profile ( Profile profil ) : System
profil Profile
리턴 System

Profile() 보호된 메소드

Initializes a new instance of the Profile class by setting the Name to a value.
protected Profile ( string name ) : System
name string /// The name to initialize the property with.
리턴 System

RaiseChangeEvent() 보호된 메소드

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.
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

RemoveEntry() 공개 추상적인 메소드

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 IProfile.RemoveEntry for additional remarks.
/// is true. /// Either section or entry is null.
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

RemoveSection() 공개 추상적인 메소드

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 IProfile.RemoveSection for additional remarks.
/// is true. /// section is null.
public abstract RemoveSection ( string section ) : void
section string /// The name of the section to remove.
리턴 void

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.

/// is true or /// is null or empty. /// ds is null.
public SetDataSet ( DataSet ds ) : void
ds System.Data.DataSet /// The DataSet object containing the data to be set.
리턴 void

SetValue() 공개 추상적인 메소드

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 IProfile.SetValue for additional remarks.
/// is true or /// is null or empty. /// Either section or entry is null.
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

VerifyAndAdjustEntry() 보호된 메소드

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.
/// entry is null.
protected VerifyAndAdjustEntry ( string &entry ) : void
entry string /// The entry name to verify and adjust.
리턴 void

VerifyAndAdjustSection() 보호된 메소드

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.
/// section is null.
protected VerifyAndAdjustSection ( string &section ) : void
section string /// The section name to verify and adjust.
리턴 void

VerifyName() 보호된 메소드

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)
/// name is empty or null.
protected VerifyName ( ) : void
리턴 void

VerifyNotReadOnly() 보호된 메소드

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.
/// ReadOnly is true.
protected VerifyNotReadOnly ( ) : void
리턴 void