//---------------------------------------------------------------------------- // // Copyright (c) Intel Corporation, 2008 - 2009 All Rights Reserved. // // File: CimParam.cs // // Contents: CimParam is a part of the CimFramework project. // It implements a Cim param class. // //---------------------------------------------------------------------------- using System; using System.Reflection; using System.Collections; using System.Collections.Generic; using System.Text; using System.Xml; using System.Xml.XPath; using System.Xml.Serialization; using Intel.Manageability.Cim; using Intel.Manageability.Exceptions; namespace Intel.Manageability.Cim { /// /// A class which store the data in the order it was inserted . /// This class is the base class for all cim classes. /// public abstract class CimParam : CimData { public CimParam(string className, string nameSpace) : base(className, nameSpace) { } /// /// Append New CIM Field /// /// Field name /// Array of field values. public override void AddField(string name, string[] values) { if (values == null) throw new NullReferenceException(); if (ContainsField(name)) throw (new CimException(string.Format("AddField: Field \"{0}\" already exists", name))); XmlElement root = _xmlMembers.DocumentElement; foreach (string val in values) { //Create a new node. XmlElement elem = _xmlMembers.CreateElement(name, _xmlNamespace); //elem.InnerText = val; elem.InnerXml = val; root.AppendChild(elem); } } } }