/// <summary> /// Read a manifest file /// </summary> /// <param name="uri"></param> /// <param name="file"></param> static public void AddManifest(string uri, string file) { try { FileInfo info = new FileInfo(file); MxmlCatalogs cat; if (archive.ContainsKey(file)) { cat = archive[file]; if (cat.TimeStamp == info.LastWriteTime) { if (cat.Count > 0) { catalogs.AddRange(cat.Values); } return; } } cat = new MxmlCatalogs(); cat.TimeStamp = info.LastWriteTime; cat.Read(file, null, uri); archive[file] = cat; if (cat.Count > 0) { catalogs.AddRange(cat.Values); } } catch (XmlException ex) { Console.WriteLine(ex.Message); } catch (Exception) { } }
/// <summary> /// Read a SWC catalog file /// </summary> static public void AddCatalogs(string file, byte[] rawData) { try { FileInfo info = new FileInfo(file); MxmlCatalogs cat; if (HasCatalog(file)) { cat = archive[file]; if (cat.TimeStamp == info.LastWriteTime) { if (cat.Count > 0) { catalogs.AddRange(cat.Values); } return; } } cat = new MxmlCatalogs(); cat.Read(file, rawData); cat.TimeStamp = info.LastWriteTime; archive[file] = cat; if (cat.Count > 0) { catalogs.AddRange(cat.Values); } } catch (XmlException ex) { Console.WriteLine(ex.Message); } catch (Exception) { } }
/// <summary> /// Add an archived SWC catalog /// </summary> static public void AddCatalog(string file) { MxmlCatalogs cat = archive[file]; if (cat.Count > 0) { catalogs.AddRange(cat.Values); } }