Exemplo n.º 1
0
        public override bool Start(IMouseInformation mouseInformation)
        {
            if (!Enabled || !Visible)
            {
                return(false);
            }

            base.Start(mouseInformation);

            try
            {
                if (_view != null)
                {
                    throw new InvalidOperationException("A magnification component is already active.");
                }

                var view = CreateView();
                _tileLocation = mouseInformation.Location;
                InitializeMagnificationImage();
                view.Open(SelectedPresentationImage, mouseInformation.Location, RenderImage);

                _view = view;
                return(true);
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, Context.DesktopWindow);
                return(false);
            }
        }
Exemplo n.º 2
0
        public override bool Start(IMouseInformation mouseInformation)
        {
            if (!Enabled)
            {
                return(false);
            }

            base.Start(mouseInformation);

            try
            {
                if (_view != null)
                {
                    throw new InvalidOperationException("A magnification component is already active.");
                }

                MagnificationViewExtensionPoint extensionPoint = new MagnificationViewExtensionPoint();
                IMagnificationView view = (IMagnificationView)ViewFactory.CreateView(extensionPoint);

                view.Open(ToolSettings.Default.MagnificationFactor,
                          (PresentationImage)SelectedPresentationImage, mouseInformation.Location);

                _view = view;
                return(true);
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, Context.DesktopWindow);
                return(false);
            }
        }
Exemplo n.º 3
0
 public override void Cancel()
 {
     if (_view != null)
     {
         _view.Close();
         _view = null;
     }
 }
Exemplo n.º 4
0
        public override void Cancel()
        {
            if (_view != null)
            {
                _view.Close();
                _view = null;
            }

            DisposeMagnificationImage();
        }
Exemplo n.º 5
0
        protected override void Dispose(bool disposing)
        {
            ToolSettings.DefaultInstance.PropertyChanged -= OnMagnificationSettingChanged;
            var view = _view as IDisposable;

            if (view != null)
            {
                view.Dispose();
                _view = null;
            }

            base.Dispose(disposing);
        }