示例#1
0
        /// <summary>
        ///     Invoked when the application is launched normally by the end user.  Other entry points
        ///     will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (Debugger.IsAttached)
            {
                DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            // ReSharper disable once RedundantAssignment
            if (!(Window.Current.Content is Frame rootFrame))
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            UnitTestClient.CreateDefaultUI();

            // Ensure the current window is active
            Window.Current.Activate();

            UnitTestClient.Run(e.Arguments);
        }
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (Debugger.IsAttached)
            {
                DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            var rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            UnitTestClient.CreateDefaultUI();

            // Ensure the current window is active
            Window.Current.Activate();

            UnitTestClient.Run(e.Arguments);
        }
示例#3
0
        public void SplitArgumentsShouldSplitAtSpacesOutsideOfQuotes()
        {
            var expected = new string[] { "--port", "8080", "--endpoint", "127.0.0.1:8020", "--diag", "abc", "txt" };
            var argument = "--port 8080 --endpoint 127.0.0.1:8020 --diag abc txt";

            string[] argsArr = UnitTestClient.SplitArguments(argument);

            Assert.AreEqual(argsArr.Length, 7);
            CollectionAssert.AreEqual(argsArr, expected);
        }
示例#4
0
        public void SplitArgumentsShouldHonorSingleQuotes()
        {
            var expected = new string[] { "--port", "8080", "--endpoint", "127.0.0.1:8020", "--diag", "\'abc txt\'" };
            var argument = "--port 8080 --endpoint 127.0.0.1:8020 --diag \'abc txt\'";

            string[] argsArr = UnitTestClient.SplitArguments(argument);

            Assert.AreEqual(argsArr.Length, 6);
            CollectionAssert.AreEqual(argsArr, expected);
        }
示例#5
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            if (Window.Current.Content is not Frame rootFrame)
            {
                rootFrame = new Frame();
                rootFrame.NavigationFailed += OnNavigationFailed;
                Window.Current.Content      = rootFrame;
            }

            UnitTestClient.Run(e.Arguments);
        }
示例#6
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            if (!(Window.Current.Content is Frame rootFrame))
            {
                rootFrame = new Frame();
                rootFrame.NavigationFailed += (sender, e) =>
                                              throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
                Window.Current.Content = rootFrame;
            }

            DebugSettings.EnableFrameRateCounter = Debugger.IsAttached;
            UnitTestClient.CreateDefaultUI();
            Window.Current.Activate();
            UnitTestClient.Run(e.Arguments);
        }
示例#7
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            var rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                rootFrame = new Frame();
                rootFrame.NavigationFailed += OnNavigationFailed;
                Window.Current.Content      = rootFrame;
            }

            UnitTestClient.CreateDefaultUI();

            Window.Current.Activate();

            UnitTestClient.Run(e.Arguments);
        }
示例#8
0
 /// <summary>
 /// Invoked when the application is launched normally by the end user. Other entry points will be used when the application is launched to open a
 /// specific file, to display search results, and so forth.
 /// </summary>
 /// <param name="event">Details about the launch request and process.</param>
 protected override void OnLaunched(LaunchActivatedEventArgs @event)
 {
     UnitTestClient.CreateDefaultUI();
     base.OnLaunched(@event);
     UnitTestClient.Run(@event.Arguments);
 }