Click here to Skip to main content
15,885,818 members
Articles / Programming Languages / XML

TreeConfiguration - configuration made as simple as it gets (or sets)

Rate me:
Please Sign up or sign in to vote.
4.66/5 (44 votes)
2 Nov 200514 min read 83.4K   724   67  
Manage configuration data with a few lines of code. Very few.
<?xml version="1.0"?>
<doc>
	<members>
		<!-- ConfigurationPath class -->
		<member name="T:ConfigurationPath">
			<summary>Provides node/key path management</summary>
			<remarks>
				<c>ConfigurationPath</c> is a wrapper around node/key path, providing positioning 
      and iteration through path segments.</remarks>
		</member>
		<!-- Constructors -->
		<member name="M:ConfigurationPath">
			<summary>Creates a new <see cref="ConfigurationPath"/> instance.</summary>
			<param name="path">Path.</param>
			<remarks></remarks>
		</member>
		<!-- Properties -->
		<member name="P:FirstSegment">
			<summary>Gets the name of the first (leftmost) path segment.</summary>
			<value>Accesses the underlying <c>_path</c> member</value>
			<exception cref="System.SystemException.InvalidOperationException">If the path doesn't contain any segments</exception> 
		</member>
		<member name="P:CurrentSegment">
			<summary>Gets the name of the current path segment.</summary>
			<value>Accesses the underlying <c>_path</c> member</value>
			<exception cref="System.SystemException.InvalidOperationException">If the current path segment is not set or is invalid</exception> 
		</member>
		<member name="P:LastSegment">
			<summary>Gets the name of the last (rightmost) path segment.</summary>
			<value>Accesses the underlying <c>_path</c> member</value>
			<exception cref="System.SystemException.InvalidOperationException">If the path doesn't contain any segments</exception> 			
		</member>
		<member name="P:Length">
			<summary>Gets the path length expressed as a number of segments.</summary>
			<value>Accesses the underlying <c>_path</c> member.</value>
		</member>
		<member name="P:EndOfPath">
			<summary>Gets a value indicating whether the current position is at the end of the path.</summary>
			<value>
				<c>true</c> if the current position is at the end of the path, or there is no path set; otherwise, <c>false</c>.</value>
		</member>
		<!-- Regular methods -->
		<member name="M:SetPath">
			<summary>Performs initialization using the specified path.</summary>
			<param name="path">Path to initialize from.</param>
			<remarks>As a part of the initialization, the current position is automatically set to the very first (leftmost) path segment, if one exists.</remarks>
		</member>
		<member name="M:MoveToFirstSegment">
			<summary>Makes the first segment in the path current.</summary>
			<exception cref="System.SystemException.InvalidOperationException">If the path doesn't contain any segments</exception>			
		</member>
		<member name="M:MoveToPrevSegment">
			<summary>Makes the previous segment in the path current.</summary>
			<exception cref="System.SystemException.InvalidOperationException">If the path doesn't contain any segments or current segment is the first segment in the path</exception>
		</member>
		<member name="M:MoveToNextSegment">
			<summary>Makes the next segment in the path current.</summary>
			<exception cref="System.SystemException.InvalidOperationException">If the path doesn't contain any segments or <see cref="EndOfPath"/> is reached</exception>		</member>
		<member name="M:MoveToLastSegment">
			<summary>Makes the last segment in the path current.</summary>
			<exception cref="System.SystemException.InvalidOperationException">If the path doesn't contain any segments or <see cref="EndOfPath"/> is reached</exception>
		</member>
		<member name="M:GetCurrentSegmentParentPath">
			<summary>Gets the path to the current segment</summary>
			<returns>The full path up to (but not including) the current segment.</returns>
		</member>
	</members>
</doc>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
France France
Vladimir Klisic is a half-human, half-software development engineer, currently working for Trema Laboratories in southeastern France (Sophia-Antipolis).

Comments and Discussions