iSpyApplication.MainForm.LoadPTZs C# (CSharp) Method

LoadPTZs() private static method

private static LoadPTZs ( string path ) : void
path string
return void
        private static void LoadPTZs(string path)
        {
            try
            {
                var s = new XmlSerializer(typeof(PTZSettings2));
                PTZSettings2 c;
                using (var fs = new FileStream(path, FileMode.Open))
                {
                    fs.Position = 0;
                    using (TextReader reader = new StreamReader(fs))
                    {
                        c = (PTZSettings2)s.Deserialize(reader);
                        reader.Close();
                    }
                    fs.Close();
                }

                _ptzs = c.Camera?.ToList() ?? new List<PTZSettings2Camera>();
            }
            catch (Exception)
            {
                MessageBox.Show(LocRm.GetString("PTZError"), LocRm.GetString("Error"));
            }
        }
MainForm