コード例 #1
0
        /// <summary>
        /// Read default Data XML Default
        /// Load data into data grid
        /// </summary>
        private void UpdateDatagridSchedule()
        {
            LoadDefaultDataFile();

            NailSalonXMLDAO NailSalonDAO = XMLHelpers.Instance();

            scheduleViewModel.Today           = DateTime.Now;
            scheduleViewModel.AppointmentList = NailSalonDAO.Appointments;
        }
コード例 #2
0
        public static void ReadFromXML(string path)
        {
            TextReader textReader = null;

            try
            {
                XmlSerializer xmlSerializer = new XmlSerializer(typeof(NailSalonXMLDAO));

                textReader = new StreamReader(path);
                nailSalonXMLDAOInstance = (NailSalonXMLDAO)xmlSerializer.Deserialize(textReader);
            } catch (Exception e)
            {
                textReader.Close();
                throw new Exception("Failed to loading data file." + e.InnerException.Message);
            } finally
            {
                textReader.Close();
            }
        }