Exemplo n.º 1
0
		/// <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;
		}
Exemplo n.º 2
0
        /// <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;
        }
Exemplo n.º 3
0
 private void InitData(AgendaSystem agenda)
 {
     this.agendaSystem = agenda;
     this.persons = agendaSystem.PersonsList;
 }