Ejemplo n.º 1
0
        public override void Close()
        {
            Area.WindowSizeChanged -= Area_WindowSizeChanged;
            Task.Factory.StartNew(() => {
                try
                {
                    if (presentation != null)
                    {
                        presentation.end();
                    }
                    if (component != null)
                    {
                        component.dispose();
                    }
                    if (desktop != null && desktop.getCurrentComponent() == null)                     // no component is running anymore
                    {
                        desktop.terminate();
                    }
                }
                catch (DisposedException)
                {
                    // ignore
                }
            }).ContinueWith((t) =>
            {
                controller = null;

                base.Close();
            });
        }
Ejemplo n.º 2
0
        private void Start()
        {
            controller = null;

            SetDisplay();

            presentation.start();

            int i = 1;
            while (controller == null && i < 150)
            {
                Thread.Sleep(100);
                i++;
                controller = presentation.getController();
            }

            if (controller == null)
                throw new InvalidOperationException();

            controller.addSlideShowListener(listener);

            if (!isEndless.HasValue)
                isEndless = controller.isEndless();

            controller.gotoSlideIndex(restoreSlideIndex.HasValue ? restoreSlideIndex.Value : 0);

            IntPtr presenterConsoleHandle;

            GetWindowHandles(out presenterConsoleHandle, out presentationHandle);

            WordsLive.Presentation.Wpf.Interop.RemoveFromAeroPeek(presentationHandle);

            if (presenterConsoleHandle != IntPtr.Zero)
            {
                ShowWindow(presenterConsoleHandle, 0); // hide presenter console
            }

            ResizeWindow();

            if (!isShown)
            {
                ShowWindow(presentationHandle,11); // hide presentation window if needed // 0

                IntPtr child = FindWindowEx(presentationHandle, IntPtr.Zero, "SALOBJECT", null);
                IntPtr child2 = FindWindowEx(child, IntPtr.Zero, "SALOBJECTCHILD", null);

                ShowWindow(child, 11);
            }

            if (preview != null)
            {
                (preview as LiveWindowPreviewProvider).UpdateSource(presentationHandle);
            }

            Controller.Dispatcher.Invoke(new Action(() => Controller.FocusMainWindow(true)));
        }
Ejemplo n.º 3
0
        public override void Close()
        {
            Area.WindowSizeChanged -= Area_WindowSizeChanged;
            Task.Factory.StartNew(() => {
                try
                {
                    if (presentation != null)
                        presentation.end();
                    if (component != null)
                        component.dispose();
                    if (desktop != null && desktop.getCurrentComponent() == null) // no component is running anymore
                        desktop.terminate();
                }
                catch (DisposedException)
                {
                    // ignore
                }
            }).ContinueWith((t) =>
            {
                controller = null;

                base.Close();
            });
        }
Ejemplo n.º 4
0
        private void Start()
        {
            controller = null;

            SetDisplay();

            presentation.start();

            int i = 1;

            while (controller == null && i < 150)
            {
                Thread.Sleep(100);
                i++;
                controller = presentation.getController();
            }

            if (controller == null)
            {
                throw new InvalidOperationException();
            }

            controller.addSlideShowListener(listener);

            if (!isEndless.HasValue)
            {
                isEndless = controller.isEndless();
            }

            controller.gotoSlideIndex(restoreSlideIndex.HasValue ? restoreSlideIndex.Value : 0);

            IntPtr presenterConsoleHandle;

            GetWindowHandles(out presenterConsoleHandle, out presentationHandle);

            WordsLive.Presentation.Wpf.Interop.RemoveFromAeroPeek(presentationHandle);

            if (presenterConsoleHandle != IntPtr.Zero)
            {
                ShowWindow(presenterConsoleHandle, 0);                 // hide presenter console
            }

            ResizeWindow();

            if (!isShown)
            {
                ShowWindow(presentationHandle, 11);                // hide presentation window if needed // 0

                IntPtr child  = FindWindowEx(presentationHandle, IntPtr.Zero, "SALOBJECT", null);
                IntPtr child2 = FindWindowEx(child, IntPtr.Zero, "SALOBJECTCHILD", null);

                ShowWindow(child, 11);
            }

            if (preview != null)
            {
                (preview as LiveWindowPreviewProvider).UpdateSource(presentationHandle);
            }

            Controller.Dispatcher.Invoke(new Action(() => Controller.FocusMainWindow(true)));
        }