示例#1
0
        public void UpdateUI(Status status)
        {
            ThreadPoolSample.DelayTimerStatus = status;
            DelayTimerInfo.Text = string.Format("Timer delay = {0} ms.", ThreadPoolSample.DelayTimerMilliseconds);
            DelayTimerStatus.Text = status.ToString("g");

            var createButtonEnabled = (status == Status.Started);
            CreateDelayTimerButton.IsEnabled = !createButtonEnabled;
            CancelDelayTimerButton.IsEnabled = createButtonEnabled;
        }
        public void UpdateUI(Status status)
        {
            ThreadPoolSample.PeriodicTimerStatus = status;

            switch (status)
            {
                case Status.Completed:
                    PeriodicTimerStatus.Text = string.Format("Completion count: {0}", ThreadPoolSample.PeriodicTimerCount);
                    break;
                default:
                    PeriodicTimerStatus.Text = status.ToString("g");
                    break;
            }

            PeriodicTimerInfo.Text = string.Format("Timer Period = {0} ms.", ThreadPoolSample.PeriodicTimerMilliseconds);

            if (((status != Status.Started) && (status != Status.Completed)) ||
                ((status == Status.Completed) && (ThreadPoolSample.PeriodicTimerMilliseconds == 0)))
            {
                CreatePeriodicTimerButton.IsEnabled = true;
                CreatePeriodicTimerButton.Focus(Windows.UI.Xaml.FocusState.Keyboard);
                CancelPeriodicTimerButton.IsEnabled = false;
            }
            else
            {
                CancelPeriodicTimerButton.IsEnabled = true;
                CancelPeriodicTimerButton.Focus(Windows.UI.Xaml.FocusState.Keyboard);
                CreatePeriodicTimerButton.IsEnabled = false; 
            }
        }
示例#3
0
        public void UpdateUI(Status status)
        {
            ThreadPoolSample.WorkItemStatus = status;

            WorkItemStatus.Text = status.ToString("g");
            WorkItemInfo.Text = string.Format("Work item priority = {0}", ThreadPoolSample.WorkItemPriority.ToString("g"));

            var createButtonEnabled = (status != Status.Started);
            CreateThreadPoolWorkItemButton.IsEnabled = createButtonEnabled;
            CancelThreadPoolWorkItemButton.IsEnabled = !createButtonEnabled;
        }
        public void UpdateUI(Status status)
        {
            ThreadPoolSample.DelayTimerStatus = status;
            DelayTimerInfo.Text = string.Format("Timer delay = {0} ms.", ThreadPoolSample.DelayTimerMilliseconds);
            DelayTimerStatus.Text = status.ToString("g");

            if (status == Status.Started)
            {
                CancelDelayTimerButton.IsEnabled = true;
                CancelDelayTimerButton.Focus(Windows.UI.Xaml.FocusState.Keyboard);
                CreateDelayTimerButton.IsEnabled = false;
            }
            else
            {
                CreateDelayTimerButton.IsEnabled = true;
                CreateDelayTimerButton.Focus(Windows.UI.Xaml.FocusState.Keyboard);
                CancelDelayTimerButton.IsEnabled = false;
            }
        }