EKG_Project.IO.Heart_Class_Data_Worker.Load C# (CSharp) Method

Load() public method

public Load ( ) : void
return void
        public void Load()
        {
            Heart_Class_Data basicData = new Heart_Class_Data();

            XmlDocument file = new XmlDocument();
            string fileName = analysisName + "_Data.xml";
            file.Load(System.IO.Path.Combine(directory, fileName));

            XmlNodeList modules = file.SelectNodes("EKG/module");

            string moduleName = this.GetType().Name;
            moduleName = moduleName.Replace("_Data_Worker", "");

            foreach (XmlNode module in modules)
            {
                if (module.Attributes["name"].Value == moduleName)
                {
                    List<Tuple<int, int>> list = new List<Tuple<int, int>>();
                    XmlNodeList nodes = module.SelectNodes("ClassificationResult");
                    foreach (XmlNode node in nodes)
                    {
                        XmlNode item1 = node["item1"];
                        string readItem1 = item1.InnerText;
                        int convertedItem1 = Convert.ToInt32(readItem1, new System.Globalization.NumberFormatInfo());

                        XmlNode item2 = node["item2"];
                        string readItem2 = item1.InnerText;
                        int convertedItem2 = Convert.ToInt32(readItem2, new System.Globalization.NumberFormatInfo());

                        Tuple<int, int> read = Tuple.Create(convertedItem1, convertedItem2);
                        list.Add(read);
                    }
                    basicData.ClassificationResult = list;

                    XmlNode channelMliiDetected = module["ChannelMliiDetected"];
                    string readChannelMliiDetected = channelMliiDetected.InnerText;
                    bool convertedChannelMliiDetected = Convert.ToBoolean(readChannelMliiDetected);
                    basicData.ChannelMliiDetected = convertedChannelMliiDetected;

                }
            }
            this.Data = basicData;
        }