Exemplo n.º 1
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;
                }
            }
        }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
0
        internal void MergeDB(string newFile)
        {
            AppInfoDB tmpDB = (AppInfoDB)WinAptLib.ReadFromFile(typeof(AppInfoDB), newFile);

            foreach (AppInfoBase item in tmpDB.Items)
            {
                myAppDB.Add(item);
            }
        }
Exemplo n.º 4
0
 public HTMLParser()
 {
     catalogMap  = new Hashtable();
     myAppInfoDB = new AppInfoDB();
 }
Exemplo n.º 5
0
 public ConfigCmd()
 {
     myAppDB = new AppInfoDB();
 }