예제 #1
0
        private CameraAssociations GetCameraAssociations(string path)
        {
            CameraAssociations settings = null;

            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(CameraAssociations));
                Stream        fs         = File.OpenRead(path);

                settings = (CameraAssociations)serializer.Deserialize(fs);
                fs.Close();
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Failed to load CameraAssociations: " + ex.Message);
            }
            return(settings);
        }
예제 #2
0
        /// <summary>
        /// SaveCameraAssociations to XML File
        /// </summary>
        /// <param name="setting">CameraAssociations Settings to write to disk.</param>
        public void SaveCameraAssociations(CameraAssociations setting)
        {
            string path = GetFullPath(CameraAssociationsFileName);

            SaveXML <CameraAssociations>(setting, path);
        }