示例#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()); }
 }
示例#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()); }
 }
示例#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();
 }
示例#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();
 }