public void Add(AppInfoDB items) { foreach (AppInfoBase item in items.Items) { Add(item); } }
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); }
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; } } }
public ConfigCmd() { myAppDB = new AppInfoDB(); }
public HTMLParser() { catalogMap = new Hashtable(); myAppInfoDB = new AppInfoDB(); }