예제 #1
0
        public void Load(string path)
        {
            AssertThreading();
            if (!File.Exists(path))
            {
                throw new FileNotFoundException(path);
            }

            if (DisplayedPreviewer != null)
            {
                Unload();
            }

            var newType      = GetPreviewerClsidForPath(path);
            var newPreviewer = new TypedPreviewerHandle(this, newType);

            try
            {
                newPreviewer.ShowFirstFile(path);
            }
            catch
            {
                newPreviewer.Dispose();
                throw;
            }

            this.DisplayedPreviewer = newPreviewer;
            this._DisplayedPath     = path;
            this.LastLoadException  = null;
            this.DisplayedPathChanged?.Invoke(this, EventArgs.Empty);
        }
예제 #2
0
 private void Unload()
 {
     AssertThreading();
     DisplayedPreviewer?.Dispose();
     DisplayedPreviewer = null;
 }