private void LoadConfiguration(ConfigureEventArgs cpea) { var databaseFileNode = (XmlElement)cpea.Document.SelectSingleNode("//cherryTomato/databaseFile"); if (databaseFileNode != null) { this.databaseFilename = databaseFileNode.GetAttribute("path"); } this.connection = new DatabaseConnection(this.databaseFilename); var ea = new ConnectToDbEventArgs(this.connection); this.connectToDbEvent.Fire(ea); }
private void SaveConfiguration(ConfigureEventArgs cpea) { var databaseFileNode = cpea.Document.CreateElement("databaseFile"); databaseFileNode.SetAttribute("path", this.databaseFilename); cpea.RootNode.AppendChild(databaseFileNode); }
private void SaveConfiguration(ConfigureEventArgs cpea) { var hasRunNode = cpea.Document.CreateElement("hasRun"); cpea.RootNode.AppendChild(hasRunNode); }
private void LoadConfiguration(ConfigureEventArgs cpea) { var hasRunNode = cpea.Document.SelectSingleNode("//cherryTomato/hasRun"); this.HasRun = hasRunNode != null; }
private void SaveConfig(ConfigureEventArgs cea) { if (this.allReminders.Count != 0) { var configNode = cea.ConfigNode; var remindersNode = cea.Document.CreateElement("reminders"); configNode.AppendChild(remindersNode); foreach (var reminder in allReminders) { this.AllReminderPlugins.GetPlugin(reminder).SaveReminder(reminder, remindersNode); } } }
private void LoadConfig(ConfigureEventArgs cea) { var reminderNodes = cea.ConfigNode.SelectNodes("reminders/reminder"); foreach (XmlElement reminderNode in reminderNodes) { var typeName = reminderNode.GetAttribute("typeName"); var plugin = this.AllReminderPlugins.GetPlugin(typeName); if (plugin == null) { Trace.WriteLine("Plugin for reminders of type '" + typeName + "' is not registered."); continue; } var reminder = plugin.LoadReminder(reminderNode); this.AddReminder(reminder); } }
private void SaveConfig(ConfigureEventArgs cea) { var rootNode = cea.RootNode; var newestKnownVersionNode = cea.Document.CreateElement("newestKnownVersion"); newestKnownVersionNode.SetAttribute("major", this.NewestKnownVersion.Major.ToString()); newestKnownVersionNode.SetAttribute("minor", this.NewestKnownVersion.Minor.ToString()); rootNode.AppendChild(newestKnownVersionNode); }
private void LoadConfig(ConfigureEventArgs cea) { var newestKnownVersionNode = (XmlElement)cea.RootNode.SelectSingleNode("newestKnownVersion"); if (newestKnownVersionNode != null) { var minor = int.Parse(newestKnownVersionNode.GetAttribute("minor")); var major = int.Parse(newestKnownVersionNode.GetAttribute("major")); this.NewestKnownVersion = new Version(major, minor); } }