Exemplo n.º 1
0
        /// <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);
                MxmlCatalog cat;
                if (archive.ContainsKey(file))
                {
                    cat = archive[file];
                    if (cat.TimeStamp == info.LastWriteTime)
                    {
                        if (cat.Count > 0)
                        {
                            catalogs[file] = cat;
                        }
                        return;
                    }
                }

                cat           = new MxmlCatalog();
                cat.URI       = uri;
                cat.TimeStamp = info.LastWriteTime;
                cat.Read(file, null);

                if (cat.Count > 0)
                {
                    catalogs[file] = cat;
                }
            }
            catch (XmlException ex) { Console.WriteLine(ex.Message); }
            catch (Exception) { }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Read a SWC catalog file
        /// </summary>
        static public void AddCatalog(string file, byte[] rawData)
        {
            try
            {
                FileInfo    info = new FileInfo(file);
                MxmlCatalog cat;
                if (HasCatalog(file))
                {
                    cat = archive[file];
                    if (cat.TimeStamp == info.LastWriteTime)
                    {
                        if (cat.Count > 0)
                        {
                            catalogs[file] = cat;
                        }
                        return;
                    }
                }

                cat = new MxmlCatalog();
                cat.Read(file, rawData);
                cat.TimeStamp = info.LastWriteTime;

                if (cat.Count > 0)
                {
                    catalogs[file] = cat;
                }
            }
            catch (XmlException ex) { Console.WriteLine(ex.Message); }
            catch (Exception) { }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Add an archived SWC catalog
        /// </summary>
        static public void AddCatalog(string file)
        {
            MxmlCatalog cat = archive[file];

            if (cat.Count > 0)
            {
                catalogs[file] = cat;
            }
        }