Ejemplo n.º 1
0
        private void InitialiseVariables(string configurationFilePath)
        {
            _configurationFilePath = configurationFilePath;

            LRM_XmlSchame schema = new LRM_XmlSchame();

            schema = LRM_LoadingXmlFile.Deserialization(_configurationFilePath);

            //miejsce na przypisanie zmiennych
            _localPcIpAddress = schema.XML_localPcIpAddress;
            _areaName         = schema.XML_areaName;

            //tworzenie słownika ze struktur
            _lrmToSubnetworksDictionary = new Dictionary <string, string>();
            foreach (LrmDescription element in schema.XML_LrmList)
            {
                _lrmToSubnetworksDictionary.Add(element.areaName, element.ipAddress);
            }
            //tworzę słownik SNPP
            _snppList = schema.XML_SnppList;

            //alokacja słowników
            _isSnpNegotiationAnswerBack      = new Dictionary <int, bool>();
            _snpNegotiationAnswerBack        = new Dictionary <int, SignalMessage>();
            _snpNegotiatinAnswerBackAreaName = new Dictionary <int, string>();

            _isSnpRealiseAnswerBack = new Dictionary <int, bool>();
            _snpRealiseAnswerBack   = new Dictionary <int, bool>();
        }
Ejemplo n.º 2
0
        public static void Serialization(string configFilePath, LRM_XmlSchame dataSource)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(LRM_XmlSchame));

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