Exemplo n.º 1
0
        private void Extract(IExtractable item, ExtractCounter counter)
        {
            try
            {
                switch (item.GetContentType())
                {
                case 0:
                    if (SaveImage(item))
                    {
                        counter.Extracted++;
                    }
                    break;

                case 1:
                    if (writeModelFileFunc != null && SaveModel(item))
                    {
                        counter.Extracted++;
                    }
                    break;

                case 2:
                    if (writeSoundFileFunc != null && SaveSound(item))
                    {
                        counter.Extracted++;
                    }
                    break;
                }
            }
            catch (Exception e)
            {
                LogError($"Error extracting {item.DisplayName}", e);
                counter.Errors++;
            }
        }
Exemplo n.º 2
0
 public TeintureModif(IExtractable e)
     : base(0xE28)
 {
     Weight    = 0.1;
     Name      = "Essence " + e.getName;
     m_Couleur = e.getHue;
     Hue       = Couleur;
 }
Exemplo n.º 3
0
        private bool SaveSound(IExtractable item)
        {
            ISoundContainer container;

            if (item.GetSoundContent(out container) && SaveSound(container, item.Destination))
            {
                LogOutput($"Extracted {item.DisplayName}");
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        private bool SaveModel(IExtractable item)
        {
            IRenderGeometry geometry;

            if (item.GetGeometryContent(out geometry) && SaveModel(geometry, item.Destination))
            {
                LogOutput($"Extracted {item.DisplayName}");
                return(true);
            }

            return(false);
        }
Exemplo n.º 5
0
        private bool SaveImage(IExtractable item)
        {
            IBitmap bitmap;

            if (item.GetBitmapContent(out bitmap) && SaveImage(bitmap, item.Destination))
            {
                LogOutput($"Extracted {item.DisplayName}");
                return(true);
            }

            return(false);
        }
Exemplo n.º 6
0
 private ExtractChainFactory(OSPlatform osplatform)
 {
     if (OSPlatform.Windows == osplatform)
     {
         WindowsExtractChain winChain = new WindowsExtractChain();
         winChain.AddExtractor(new WinEnExtractChain()).AddExtractor(new WinChsExtractChain());
         _chain = winChain;
     }
     else if (OSPlatform.Linux == osplatform)
     {
         _chain = null;
         throw new System.NotImplementedException();
     }
     else
     {
         _chain = null;
         throw new System.NotImplementedException();
     }
 }
Exemplo n.º 7
0
 public RawDocument(IExtractable extractor)
 {
     text = extractor.GetRawText ();
     format = "";
 }
Exemplo n.º 8
0
        public static ETL Create(IExtractable extractionStage)
        {
            _extractionStage = extractionStage;

            return(new ETL());
        }
Exemplo n.º 9
0
 /// <summary>
 /// 添加提取器
 /// </summary>
 /// <param name="iextract"></param>
 /// <returns></returns>
 public WindowsExtractChain AddExtractor(IExtractable iextract)
 {
     chainList.Add(iextract);
     return(this);
 }