/// <summary>
        /// Saves the configuration to the specified writer.
        /// </summary>
        protected override void Save(TextWriter writer)
        {
            XmlDocument    xmlDoc  = new();
            XmlDeclaration xmlDecl = xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null);

            xmlDoc.AppendChild(xmlDecl);

            XmlElement rootElem = xmlDoc.CreateElement("MqttPublisherDeviceConfig");

            xmlDoc.AppendChild(rootElem);

            DeviceOptions.SaveToXml(rootElem.AppendElem("DeviceOptions"));
            XmlElement itemsElem = rootElem.AppendElem("Items");

            foreach (ItemConfig itemConfig in Items)
            {
                itemConfig.SaveToXml(itemsElem.AppendElem("Item"));
            }

            xmlDoc.Save(writer);
        }
        /// <summary>
        /// Loads the configuration from the specified reader.
        /// </summary>
        protected override void Load(TextReader reader)
        {
            XmlDocument xmlDoc = new();

            xmlDoc.Load(reader);
            XmlElement rootElem = xmlDoc.DocumentElement;

            if (rootElem.SelectSingleNode("DeviceOptions") is XmlNode deviceOptionsNode)
            {
                DeviceOptions.LoadFromXml(deviceOptionsNode);
            }

            if (rootElem.SelectSingleNode("Items") is XmlNode itemsNode)
            {
                foreach (XmlElement itemElem in itemsNode.SelectNodes("Item"))
                {
                    ItemConfig itemConfig = new() { Parent = Items };
                    itemConfig.LoadFromXml(itemElem);
                    Items.Add(itemConfig);
                }
            }
        }
 /// <summary>
 /// Sets the default values.
 /// </summary>
 protected override void SetToDefault()
 {
     DeviceOptions = new DeviceOptions();
     Items         = new ItemList();
 }