コード例 #1
0
        private void InitialiseVariables(string configurationFilePath)
        {
            _configurationFilePath = configurationFilePath;

            PC_XmlSchame tmp = new PC_XmlSchame();

            tmp = PC_LoadingXmlFile.Deserialization(_configurationFilePath);

            _pcIpAddress = tmp.XML_myIPAddress;
            _pcPort      = tmp.XML_myPortNumber;
        }
コード例 #2
0
        public static void Serialization(string configFilePath, PC_XmlSchame dataSource)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(PC_XmlSchame));

            try
            {
                using (TextWriter writer = new StreamWriter(configFilePath, false))
                {
                    serializer.Serialize(writer, dataSource);
                }
            }
            catch (Exception e)
            {
                SignallingNodeDeviceClass.MakeSignallingLog("PC", "ERROR - Serialization cannot be complited.");
            }
        }