コード例 #1
0
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            base.OnInitialized();

            IntPtr mainWindowHandle = new System.Windows.Interop.WindowInteropHelper(MainWindow).EnsureHandle();

            try
            {
                _scriptVideoService.SetPresentationWindow(mainWindowHandle);
            }
            catch (Exception ex)
            {
                _systemDialogService.ShowErrorDialog("Closing due to an exception while attempting to set the Script Video Service presentation window", "Initialization Error", ex);
                Shutdown();
            }

            if (!_clipboardService.SetMonitorWindow(mainWindowHandle))
            {
                _systemDialogService.ShowErrorDialog("Closing due to a failure initializing the Clipboard service.", "Initialization Error");
                Shutdown();
            }
        }