private void BuildPackageList(CardLibrary cardLibrary) { SortedList sl = new SortedList(); string[] ss = null; int count = cardLibrary.GetNonDIYCount(); for (int i = 0; i < count; i++) { ss = cardLibrary.GetCardByIndex(i).package.Split(',', ','); foreach (string s in ss) { if (!sl.Contains(s)) { sl.Add(s, s); } } } ss = new string[sl.Count]; for (int i = 0; i < sl.Count; i++) { ss[i] = (string)sl.GetByIndex(i); } File.WriteAllLines(appPath + "\\PackageList.txt", ss); }
private int Load(int index) { CardDescription card = cardLibrary.GetCardByIndex(index); if (card == null) { card = null; return(0); } string filename = null; if (card.cardCamp == CardCamp.DIY) { filename = DIYIcoPath + card.name + ".jpg"; } else { filename = IcoPath + card.ID.ToString() + ".jpg"; } System.Windows.Forms.ImageList imageList1 = Global.frmMainHolder.imageList1; if (System.IO.File.Exists(filename)) { Global.frmMainHolder.imageList1.Images.Add(System.Drawing.Image.FromFile(filename)); if (loadoncenum > 0 && loadpicinterval > 0) { loadcounter++; if (loadcounter == loadoncenum) { Thread.Sleep(loadpicinterval); loadcounter = 0; } } } else { return(0); } return(imageList1.Images.Count - 1); }