Пример #1
0
 /// <summary>
 /// Overload that allows you to import an AdPackEntry over an existing item,
 /// instead of reading raw image data.
 /// </summary>
 /// <param name="contentId">The contentId to overwrite.</param>
 /// <param name="ad">The AdPackEntry with the data to insert.</param>
 public void ImportImage(uint contentId, AdPackEntry ad)
 {
     ImportImage(contentId, ad.DDSData);
 }
Пример #2
0
 /// <summary>
 /// Imports a new entry into the database from an adpack.
 /// </summary>
 /// <param name="ad">The AdPackEntry to import.</param>
 public uint NewEntry(AdPackEntry ad)
 {
     return this.NewEntry(ad.ToContentEntry());
 }
Пример #3
0
        private void HandleFileList(byte[] filelist)
        {
            String fl = ASCIIEncoding.ASCII.GetString(filelist);
            foreach (String entry in fl.Split('\n'))
            {
                String centry = entry.Trim();
                if (centry.Length > 1)
                {
                    SortedList<String, String> entryitems = new SortedList<string, string>();
                    foreach (String pair in centry.Split(';'))
                    {
                        if (pair.Trim().Length > 1)
                        {
                            String[] kv = pair.Trim().Split('=');
                            entryitems[kv[0].Trim()] = kv[1].Trim();
                        }
                    }

                    // handle the entry
                    Files[entryitems["filename"]] = new AdPackEntry(entryitems["filename"], entryitems["title"], new ContentType(UInt32.Parse(entryitems["contentType"])));
                }
            }
        }