Ejemplo n.º 1
0
 public DB()
 {
     try {
         ex = new ExcludedItems();
         XmlSerializer xs = new XmlSerializer( typeof( XmlItem[] ), new XmlRootAttribute( "ArrayOfXmlItem" ) );
         using ( FileStream myFileStream = new FileStream( @"aodb.xml", FileMode.Open ) ) {
             XmlItem[] i;
             i = ( XmlItem[] ) xs.Deserialize( myFileStream );
             items = new List<Item>();
             foreach(XmlItem xi in i) {
                 if(!ex.ids.Contains(xi.aoid) && xi.test()) items.Add(xi.toItem());
             }
         }
     }
     catch(Exception fail) { MessageBox.Show(fail.ToString()); }
 }
Ejemplo n.º 2
0
 public DB()
 {
     try {
         ex = new ExcludedItems();
         XmlSerializer xs = new XmlSerializer(typeof(XmlItem[]), new XmlRootAttribute("ArrayOfXmlItem"));
         using (FileStream myFileStream = new FileStream(@"aodb.xml", FileMode.Open)) {
             XmlItem[] i;
             i     = ( XmlItem[] )xs.Deserialize(myFileStream);
             items = new List <Item>();
             foreach (XmlItem xi in i)
             {
                 if (!ex.ids.Contains(xi.aoid) && xi.test())
                 {
                     items.Add(xi.toItem());
                 }
             }
         }
     }
     catch (Exception fail) { MessageBox.Show(fail.ToString()); }
 }
Ejemplo n.º 3
0
 private void init(System.Object sender, System.EventArgs e)
 {
     // Parts of the init that are expected to take some time
     ex = new ExcludedItems();
     db = new DB();
 }
Ejemplo n.º 4
0
 private void init(System.Object sender, System.EventArgs e)
 {
     // Parts of the init that are expected to take some time
     ex = new ExcludedItems();
     db = new DB();
 }