Exemplo n.º 1
0
        public void SetActiveTask(Tasks.Task newTask)
        {
            // first, are we active? If we aren't, there's no way
            // we ever activated a task, so there's no need to deactivate anything.
            if (IsFragmentActive == true)
            {
                // we are active, so if we have a current task, deactivate it.
                if (ActiveTask != null)
                {
                    ActiveTask.Deactivate(false);
                }

                // activate the new task
                newTask.Activate(false);

                // force the springboard to close
                if (MainActivity.IsLandscapeWide( ) == false)
                {
                    RevealSpringboard(false);
                }
            }
            else
            {
                // activate the new task
                newTask.Activate(false);
            }

            // take our active task. If we didn't activate it because we aren't
            // ready, we'll do it as soon as OnResume is called.
            ActiveTask = newTask;
        }
Exemplo n.º 2
0
        private void ActivateTab(Control page, bool okTouseTimer)
        {
            var task = (ITask)page.Tag;

            if (ActiveTask == task)
            {
                return;                 //debounce
            }

            if (ActiveTask != null)
            {
                ActiveTask.Deactivate();
                _activeTask = null;
            }
            if (task != null)
            {
                page.Cursor = Cursors.WaitCursor;
                page.Controls.Clear();
                if (Visible && okTouseTimer)
                {
                    ActivateAfterScreenDraw(page, task);
                }
                else
                {
                    ActivateTask(page, task);
                }
                UsageReporter.SendNavigationNotice(task.Label);
            }
        }
Exemplo n.º 3
0
        public override void OnPause( )
        {
            base.OnPause( );

            if (ActiveTask != null)
            {
                ActiveTask.Deactivate(true);
            }

            IsFragmentActive = false;

            // force the animation to end, because we're out of time.
            if (XPosAnimator != null)
            {
                XPosAnimator.End( );
            }
        }