示例#1
0
 public static Window OpenDialog()
 {
     if (Settings.IsGhostApp)
     {
         Ghost.Wrapper.Window ghostWndw = new Ghost.Wrapper.Window(App.MasterDialogTemplate);
         ghostWndw.CloseButtonState = Ghost.CloseButtonStates.Close;
         return(ghostWndw);
     }
     else
     {
         HVCC.Prototype2.PrototypeWindow wndw = new HVCC.Prototype2.PrototypeWindow(App.MasterDialogTemplate);
         return(wndw);
     }
 }
示例#2
0
        private void CreateScreenShots()
        {
            try
            {
                WindowsPanel.Visibility  = Visibility.Hidden;
                ScenarioPanel.Visibility = Visibility.Hidden;
                ClearPreviewPane();
                HidePreviewContent();

                Settings.IsStaticPresentation = true;
                Settings.IsGhostApp           = false;

                App.MasterWindowTemplate = new HVCC.Prototype2.WindowMaster();

                WindowLaunchTimer          = new DispatcherTimer();
                WindowLaunchTimer.Interval = TimeSpan.FromSeconds(.1);

                if (!Directory.Exists(ScreenShotDirectoryPath))
                {
                    Directory.CreateDirectory(ScreenShotDirectoryPath);
                }

                int nWindows = 0;
                int nDialogs = 0;
                Prototype2.ControlBase curCtl = null;

                WindowLaunchTimer.Tick += delegate
                {
                    if (nWindows < HVCCPages.Windows.Count)
                    {
                        curCtl = (Prototype2.ControlBase)HVCCPages.Windows[nWindows];
                        App.RenderWindowContent(curCtl);
                        ScreenShotTimer.Start();
                        nWindows++;
                    }
                    else
                    {
                        if (nDialogs < HVCCPages.Dialogs.Count)
                        {
                            curCtl = (Prototype2.ControlBase)HVCCPages.Dialogs[nDialogs];
                            App.RenderWindowContent(curCtl);
                            ScreenShotTimer.Start();
                            nDialogs++;
                        }
                        else
                        {
                            WindowsPanel.Visibility  = Visibility.Visible;
                            ScenarioPanel.Visibility = Visibility.Visible;
                            CloseAllWindows();
                            nWindows = 0;
                            nDialogs = 0;
                            Process.Start(ScreenShotDirectoryPath);
                            Ghost.Imaging.Capture.CombineImagesInDirectory(ScreenShotDirectoryPath, "all");
                            WindowLaunchTimer.Stop();
                        }
                    }

                    ScreenShotTimer.Tick += delegate
                    {
                        Ghost.Imaging.Capture.CaptureControlImageAndSave(App.MasterWindowTemplate, ScreenShotDirectoryPath + curCtl.WindowName);
                        ScreenShotTimer.Stop();
                    };
                };

                HVCC.Prototype2.PrototypeWindow wndw = new HVCC.Prototype2.PrototypeWindow(App.MasterWindowTemplate);
                wndw.Closed     += new EventHandler(wndw_Closed);
                wndw.WindowStyle = WindowStyle.None;
                wndw.Topmost     = true;
                wndw.Show();
                WindowLaunchTimer.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n\n" + ex.Source + "\n\n" + ex.StackTrace);
                throw ex;
            }
        }