/// <summary> /// Load the specified agenda, using a given file name. /// </summary> /// <param name="fileName">A file name, as a string.</param> public static AgendaSystem Load(string fileName) { AgendaSystem toret = new AgendaSystem(); XmlDocument docXml = new XmlDocument(); // Open document toret.FileName = fileName; docXml.Load( fileName ); XmlNode mainNode = docXml.DocumentElement; if ( mainNode.Name == EtqAgenda ) { foreach(XmlNode node in mainNode.ChildNodes ) { if ( node.Name.ToLower() == PersonsList.EtqPersons ) { Tacto.Core.PersonsList.LoadPersons( node, toret.PersonsList ); } else if ( node.Name.ToLower() == Tacto.Core.CategoryList.EtqCategories ) { Tacto.Core.CategoryList.LoadCategories( node, toret.CategoryList ); } } } else throw new XmlException( EtqAgenda + " expected" ); toret.Modified = false; return toret; }
private void InitData(AgendaSystem agenda) { this.agendaSystem = agenda; this.persons = agendaSystem.PersonsList; }