Esempio n. 1
0
 public void Add(AppInfoDB items)
 {
     foreach (AppInfoBase item in items.Items)
     {
         Add(item);
     }
 }
Esempio n. 2
0
 public void Add(AppInfoDB items)
 {
     foreach (AppInfoBase item in items.Items)
     {
         Add(item);
     }
 }
Esempio n. 3
0
 public void LoadDB(string fileName)
 {
     myAppDB = (AppInfoDB)WinAptLib.ReadFromFile(typeof(AppInfoDB), fileName);
     for (int i = 0; i < myAppDB.Items.Count; i++)
     {
         ((AppInfoBase)myAppDB.Items[i]).setIndex(i);
     }
     myAppDB.SetIndex(myAppDB.Items.Count);
 }
Esempio n. 4
0
        public void UpdateAppDB(string content)
        {
            //load data from remote db.
            this.myAppDB = (AppInfoDB)WinAptLib.ReadFromStream(typeof(AppInfoDB), content);

            for (int i = 0; i < myAppDB.Items.Count; i++)
            {
                ((AppInfoBase)myAppDB.Items[i]).setIndex(i);
            }

            //compare with local data
            foreach (AppInfoBase item in this.myConfig.Items)
            {
                int index = 0;
                //already contains, mark as needDownload
                if ((index = myAppDB.Contains(item)) != -1)
                {
                    ((AppInfoBase)myAppDB.Items[index]).setState(WinAptLib.Downloaded);
                }
                //has older version, mark as needUpdate
                if ((index = myAppDB.HasOldVersion(item)) != -1)
                {
                    ((AppInfoBase)myAppDB.Items[index]).setState(WinAptLib.NewVersion);
                    ((AppInfoBase)myAppDB.Items[index]).version = ((AppInfoBase)item).version;
                }
            }
        }
Esempio n. 5
0
 public ConfigCmd()
 {
     myAppDB = new AppInfoDB();
 }
Esempio n. 6
0
 public HTMLParser()
 {
     catalogMap = new Hashtable();
     myAppInfoDB = new AppInfoDB();
 }