示例#1
0
        public void PreviewFile(string file, ContextObject context)
        {
            _control = new PreviewHandlerHost();
            Child    = _control;
            _control.Open(file);

            //SetForegroundWindow(new WindowInteropHelper(context.ViewerWindow).Handle);
            //SetActiveWindow(presenter.Handle);
        }
示例#2
0
        public void Dispose()
        {
            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                Child = null;
                _control?.Dispose();
                _control = null;

                base.Dispose();
            }));
        }
        public bool CanHandle(string path)
        {
            if (Directory.Exists(path))
            {
                return(false);
            }

            if (Extensions.Any(path.ToLower().EndsWith))
            {
                return(PreviewHandlerHost.GetPreviewHandlerGUID(path) != Guid.Empty);
            }

            return(false);
        }