Esempio n. 1
0
 public override ArcFile TryOpen(ArcView file)
 {
     using (var input = file.CreateStream())
         using (var reader = new PsbReader(input))
         {
             foreach (var key in KnownKeys)
             {
                 if (reader.Parse(key))
                 {
                     var dir = reader.GetTextures();
                     if (null == dir || 0 == dir.Count)
                     {
                         return(null);
                     }
                     else
                     {
                         return(new ArcFile(file, this, dir));
                     }
                 }
                 if (!reader.IsEncrypted)
                 {
                     break;
                 }
             }
             return(null);
         }
 }
Esempio n. 2
0
        ArcFile OpenArcFile(PsbReader reader, ArcView file)
        {
            var dir = reader.GetTextures();

            if (null == dir)
            {
                dir = reader.GetLayers();
            }
            if (null == dir || 0 == dir.Count)
            {
                return(null);
            }
            return(new ArcFile(file, this, dir));
        }