Exemplo n.º 1
0
        /// <summary>
        /// Override of <see cref="ApplicationComponent.Start"/>
        /// </summary>
        /// <remarks>
        /// For internal Framework use only.
        /// </remarks>
        public override void Start()
        {
            base.Start();

            _uiThreadSynchronizationContext = SynchronizationContext.Current;

            _contextMenuFilter = _setupHelper.GetContextMenuFilter() ?? ViewerActionFilter.Null;
            _contextMenuFilter.SetImageViewer(this);

            _toolbarFilter = _setupHelper.GetToolbarFilter() ?? ViewerActionFilter.Null;
            _toolbarFilter.SetImageViewer(this);

            _toolSet = new ToolSet(CreateTools(), CreateToolContext());

            // since the keyboard action model is otherwise never used, we explicitly invoke it here to apply the persisted action model values to the actions
            ActionModelRoot.CreateModel(ActionsNamespace, KeyboardSite, _toolSet.Actions);

            foreach (ITool tool in _toolSet.Tools)
            {
                _shortcutManager.RegisterImageViewerTool(tool);
            }

            this.backgroundWorker = new BackgroundWorker();
            this.backgroundWorker.WorkerSupportsCancellation = true;
            this.backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker_DoWork);
        }
        public override void Start()
        {
            _contextMenuFilter = _setupHelper.GetContextMenuFilter() ?? ViewerActionFilter.Null;
            _contextMenuFilter.SetImageViewer(this);

            _toolSet = new ToolSet(CreateTools(), CreateToolContext());

            // since the keyboard action model is otherwise never used, we explicitly invoke it here to apply the persisted action model values to the actions
            ActionModelRoot.CreateModel(ActionsNamespace, PrintKeyboardSite, _toolSet.Actions);

            foreach (ITool tool in _toolSet.Tools)
            {
                _shortcutManager.RegisterImageViewerTool(tool);
            }
            base.Start();
        }