iSpyApplication.MainForm.LoadSources C# (CSharp) Method

LoadSources() private static method

private static LoadSources ( string path ) : void
path string
return void
        private static void LoadSources(string path)
        {
            try
            {
                var s = new XmlSerializer(typeof(Manufacturers));
                Manufacturers c;
                using (var fs = new FileStream(path, FileMode.Open))
                {
                    fs.Position = 0;
                    using (TextReader reader = new StreamReader(fs))
                    {
                        c = (Manufacturers)s.Deserialize(reader);
                        reader.Close();
                    }
                    fs.Close();
                }
                _sources = c.Manufacturer?.Distinct().ToList() ?? new List<ManufacturersManufacturer>();

                int i = 0;
                foreach (var m in _sources)
                {
                    foreach (var u in m.url)
                    {
                        u.id = i;
                        i++;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, LocRm.GetString("Error"));
            }
        }
MainForm