コード例 #1
0
    	public static void launchDiagramDesignerGui(bool showLogViewer)
    	{
    		if (showLogViewer)
    			O2Gui.open<ascx_LogViewer>("LogViewer", 400,200);

			O2Thread.staThread(
				()=>{
						"start Sta thread".info();
						Func<System.Windows.Application> createApp = 
							()=>{
									var app = new DiagramDesigner.App();
									Uri resourceLocater = new Uri("/DiagramDesigner;component/app.xaml", UriKind.Relative);
									System.Windows.Application.LoadComponent(app, resourceLocater);
									return app;
								};
									
						var application = System.Windows.Application.Current.isNull() 
													  	? createApp()
													  	: System.Windows.Application.Current;				
						"WPF Application created".info();						
						var window1 = new Window1();  
						"DiagramDesigner Main Window created".info();						
						//show.info(window1);
						window1.Top = 10;
						window1.Left  = 10;
						window1.Width= 700;
						window1.Height= 600;
						"Launching WPF Application".info();
						application.Run(window1);
						"WPF Application ended".info();
						
						//System.Windows.Application.Current.run
					});
		}			  				
コード例 #2
0
        public static void launchDiagramDesignerGui(bool showLogViewer)
        {
            if (showLogViewer)
            {
                O2Gui.open <ascx_LogViewer>("LogViewer", 400, 200);
            }

            O2Thread.staThread(
                () => {
                "start Sta thread".info();
                Func <System.Windows.Application> createApp =
                    () => {
                    var app             = new DiagramDesigner.App();
                    Uri resourceLocater = new Uri("/DiagramDesigner;component/app.xaml", UriKind.Relative);
                    System.Windows.Application.LoadComponent(app, resourceLocater);
                    return(app);
                };

                var application = System.Windows.Application.Current.isNull()
                                                                                                                ? createApp()
                                                                                                                : System.Windows.Application.Current;
                "WPF Application created".info();
                var window1 = new Window1();
                "DiagramDesigner Main Window created".info();
                //show.info(window1);
                window1.Top    = 10;
                window1.Left   = 10;
                window1.Width  = 700;
                window1.Height = 600;
                "Launching WPF Application".info();
                application.Run(window1);
                "WPF Application ended".info();

                //System.Windows.Application.Current.run
            });
        }