Example #1
0
        public static PanelTypeData GetPanelTypeData()
        {
            PanelTypeData cfgData = new PanelTypeData();

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(ConfigXML);
            cfgData.Serial      = xmlDoc.SelectSingleNode("config/system/paneltype/serial").InnerText;
            cfgData.MainType    = xmlDoc.SelectSingleNode("config/system/paneltype/main").InnerText;
            cfgData.SubType     = xmlDoc.SelectSingleNode("config/system/paneltype/sub").InnerText;
            cfgData.ModalH      = xmlDoc.SelectSingleNode("config/system/paneltype/modal/h").InnerText.ToInt32();
            cfgData.ModalV      = xmlDoc.SelectSingleNode("config/system/paneltype/modal/v").InnerText.ToInt32();
            cfgData.ModalPixelH = xmlDoc.SelectSingleNode("config/system/paneltype/modalpixel/h").InnerText.ToInt32();
            cfgData.ModalPixelV = xmlDoc.SelectSingleNode("config/system/paneltype/modalpixel/v").InnerText.ToInt32();
            xmlDoc = null;
            return(cfgData);
        }
Example #2
0
        public static void SetPanelTypeData(PanelTypeData panelTypeData)
        {
            PanelTypeData cfgData = panelTypeData;

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(ConfigXML);
            xmlDoc.SelectSingleNode("config/system/paneltype/serial").InnerText       = cfgData.Serial;
            xmlDoc.SelectSingleNode("config/system/paneltype/main").InnerText         = cfgData.MainType;
            xmlDoc.SelectSingleNode("config/system/paneltype/sub").InnerText          = cfgData.SubType;
            xmlDoc.SelectSingleNode("config/system/paneltype/modal/h").InnerText      = cfgData.ModalH.ToString();
            xmlDoc.SelectSingleNode("config/system/paneltype/modal/v").InnerText      = cfgData.ModalV.ToString();
            xmlDoc.SelectSingleNode("config/system/paneltype/modalpixel/h").InnerText = cfgData.ModalPixelH.ToString();
            xmlDoc.SelectSingleNode("config/system/paneltype/modalpixel/v").InnerText = cfgData.ModalPixelV.ToString();

            xmlDoc.Save(ConfigXML);
            xmlDoc = null;
        }