Exemple #1
0
        public void TestMethod1()
        {

            TaskWorker manager = new TaskWorker();
            //manager.Start();

           // var task = new EchoActivity("ASDFFDSA");

           // manager.AddTaskActivities(task);

            //manager.Stop();

        }
Exemple #2
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="args">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs args)
        {
#if DEBUG
            if (Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = false;
                this.DebugSettings.IsBindingTracingEnabled = true;
                this.DebugSettings.BindingFailed += (s, e) =>
                {
                    Debug.WriteLine("binding failed");
                };
            }
#endif

            switch (args.PreviousExecutionState)
            {
                case ApplicationExecutionState.Terminated:
                case ApplicationExecutionState.ClosedByUser:
                    break; // load saved application data and refresh content
                case ApplicationExecutionState.NotRunning: // normal launch
                    await TaskHelper.RegisterAll();
                    InitializeUi();
                    if (IsFirstLaunch()) OnFirstLaunch(args);
                    else OnNormalLaunch(args);
                    break;
                case ApplicationExecutionState.Running:
                // activated through secondary tile or activiation contracts and extensions
                case ApplicationExecutionState.Suspended:
                    // activated through secondary tile of activation contracts and extensions after has been suspended
                    break;
                default:
                    Log.Warn("Unexpected PreviousExecutionState");
                    break;
            }

            Worker = new TaskWorker();
            Worker.Start();
            

        }