コード例 #1
0
ファイル: frmMain.cs プロジェクト: taylor-an/AnyI2C
        //load the configure file
        public void Load()
        {
            try
            {
                XmlReader     reader     = XmlReader.Create("Config.xml");
                XmlSerializer serializer = new XmlSerializer(typeof(Configure));
                Configure     temp       = (Configure)serializer.Deserialize(reader);
                Data        = temp.Data;
                LocationID  = temp.LocationID;
                Opened      = temp.Opened;
                PortName    = temp.PortName;
                LogDataType = temp.LogDataType;

                reader.Close();
            }
            catch (Exception e)
            {
                Debug.Print("Fail to load configure file.");
            }
        }
コード例 #2
0
        //load the configure file
        public void Load()
        {
            try
            {
                XmlReader reader = XmlReader.Create("Config.xml");
                XmlSerializer serializer = new XmlSerializer(typeof(Configure));
                Configure temp = (Configure)serializer.Deserialize(reader);
                Data = temp.Data;
                LocationID = temp.LocationID;
                Opened = temp.Opened;
                PortName = temp.PortName;
                LogDataType = temp.LogDataType;

                reader.Close();
            }
            catch (Exception e)
            {
                Debug.Print("Fail to load configure file.");
            }
        }