Esempio n. 1
0
        public static EntryType.AllEntries ConstructGlob(List <Alarm> aAls, List <Timer> aTms,
                                                         List <Reminder> aRms)
        {
            EntryType.AllEntries newGlob = new EntryType.AllEntries();

            newGlob.Als = aAls; newGlob.Tms = aTms;
            newGlob.Rms = aRms;

            return(newGlob);
        }
Esempio n. 2
0
        private void BtnDbgSave_Click(object sender, EventArgs e)
        {
            //construct & deconstructGlob() need to be moved to EntryType
            EntryType.AllEntries theGlob = EntryType.ConstructGlob(activeAlarms,
                                                                   activeTimers, activeReminders);

            try {
                FileIO.WriteActivesXML <EntryType.AllEntries>(FileIO.saveDataLoc,
                                                              theGlob);
            } catch (Exception ex) {
                Debug.ShowException("Save: " + ex.Message);
            }

            MessageBox.Show("Alarms/Timers/Reminders Saved", "Save Successful",
                            MessageBoxButtons.OK);
        }
Esempio n. 3
0
        public static void WriteActivesXML<List>(string path,
          EntryType.AllEntries glob) {

            try {
                using (Stream stream = File.Open(path, FileMode.Create)) {
                    var xmlFmttr = new System.Xml.Serialization.XmlSerializer(
                      typeof(EntryType.AllEntries));

                    //don't forget to try/catch wrap .Serialize(), too
                    try {
                        //binFmttr.Serialize(stream, glob);
                        xmlFmttr.Serialize(stream, glob);
                    } catch (Exception e) {
                        //bubble any Binary/XMLFormatter.Serialize() issues up
                        throw e;
                    }
                }
            } catch (Exception e) {
                //this one will handle any stream opening & issues from
                //above
                throw e;    //whatever bubbles bubbles up
            }
        }
Esempio n. 4
0
 public static void deconstructGlob(EntryType.AllEntries readGlob)
 {
     mainForm.activeAlarms    = readGlob.Als; mainForm.activeTimers = readGlob.Tms;
     mainForm.activeReminders = readGlob.Rms;
 }