// // NodeElement.cs // // Author: // Lluis Sanchez Gual // // Copyright (C) 2007 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections; namespace Mono.Addins { /// /// An extension node element. /// /// /// A raw representation of an extension node. Contains the basic information /// needed to create ExtensionNode instances. /// public interface NodeElement { /// /// Name of the node element. /// string NodeName { get; } /// /// Gets element attributes. /// /// /// Name of the attribute /// /// /// The value of the attribute /// string GetAttribute (string key); /// /// Gets all attributes defined in the element. /// NodeAttribute[] Attributes { get; } /// /// Gets child nodes of this node /// NodeElementCollection ChildNodes { get; } } /// /// Attribute of a NodeElement. /// public class NodeAttribute { internal string name; internal string value; internal NodeAttribute () { } /// /// Name of the attribute. /// public string Name { get { return name; } } /// /// Value of the attribute. /// public string Value { get { return value; } } } /// /// A collection of NodeElement objects /// public interface NodeElementCollection: IList, ICollection, IEnumerable { /// /// Gets the at the specified index /// /// /// Index /// new NodeElement this [int n] { get; } } }