Exemple #1
0
        private void AnalyzeArchive(string path)
        {
            // no archive handler == no analysis
            if (ArchiveHandlerFactory == null)
            {
                return;
            }

            int  offset;
            bool isExecutable;

            if (NonArchiveExtensions.Any(ext => Path.GetExtension(path).Substring(1).ToLower() == ext.ToLower()))
            {
                return;
            }

            if (ArchiveHandlerFactory.CheckSignature(path, out offset, out isExecutable))
            {
                _extractor = ArchiveHandlerFactory.Construct(path);
                try
                {
                    ScanArchive();
                    _isArchive = true;
                }
                catch
                {
                    _extractor.Dispose();
                    _extractor    = null;
                    _archiveItems = null;
                }
            }
        }
Exemple #2
0
        public void Dispose()
        {
            Unbind();

            _extractor?.Dispose();
            _rootStream?.Dispose();

            _extractor  = null;
            _rootStream = null;
        }
Exemple #3
0
        public void Dispose()
        {
            Unbind();

            if (_extractor != null)
            {
                _extractor.Dispose();
            }

            if (_rootStream != null)
            {
                _rootStream.Dispose();
            }

            _extractor  = null;
            _rootStream = null;
        }
Exemple #4
0
		public void Dispose()
		{
			Unbind();

			if (_extractor != null)
			{
				_extractor.Dispose();
			}

			if (_rootStream != null)
			{
				_rootStream.Dispose();
			}

			_extractor = null;
			_rootStream = null;
		}
Exemple #5
0
		private void AnalyzeArchive(string path)
		{
			// no archive handler == no analysis
			if (ArchiveHandlerFactory == null)
			{
				return;
			}

			int offset;
			bool isExecutable;
			if (NonArchiveExtensions.Any(ext => Path.GetExtension(path).Substring(1).ToLower() == ext.ToLower()))
			{
				return;
			}

			if (ArchiveHandlerFactory.CheckSignature(path, out offset, out isExecutable))
			{
				_extractor = ArchiveHandlerFactory.Construct(path);
				try
				{
					ScanArchive();
				}
				catch
				{
					_extractor.Dispose();
					_extractor = null;
					_archiveItems = null;
				}
			}
		}