Ejemplo n.º 1
0
        public void Add(IEntryViewModel item)
        {
            _updatingNavigationHistory = true;
            try
            {
                //GC.Collect(0, GCCollectionMode.Forced, true);
                if (NavigationPosition != -1)
                {
                    for (int i = 0; i < NavigationPosition; i++)
                    {
                        NavigationHistory.RemoveAt(0);
                    }
                }
                while (NavigationHistory.Count > 10)
                {
                    NavigationHistory.RemoveAt(NavigationHistory.Count - 1);
                }

                if (NavigationHistory.IndexOf(item) != -1)
                {
                    NavigationHistory.Remove(item);
                }
                NavigationHistory.Insert(0, item);
                NavigationPosition = 0;

                UpdateState();
            }
            finally
            {
                _updatingNavigationHistory = false;
            }
        }
Ejemplo n.º 2
0
        private void AddNavigationHistory(ViewerBaseVM item)
        {
            if (NavigationPosition != -1)
            {
                for (int i = 0; i < NavigationPosition; i++)
                {
                    NavigationHistory.RemoveAt(0);
                }
            }
            while (NavigationHistory.Count > 10)
            {
                NavigationHistory.RemoveAt(NavigationHistory.Count - 1);
            }

            if (NavigationHistory.IndexOf(item) != -1)
            {
                NavigationHistory.Remove(item);
            }
            NavigationHistory.Insert(0, item);
            NavigationPosition = 0;

            //if (jpList != null)
            //{
            //    jpList.AddToRecent(item.EmbeddedDirectoryModel.EmbeddedDirectoryEntry.ParseName);
            //    jpList.Refresh();
            //}
        }
Ejemplo n.º 3
0
        private void AddToHistory(SimpleViewModel navObj)
        {
            if (NavigationHistory.Count >= MaxHistoryObjects)
            {
                NavigationHistory.RemoveAt(0);
            }

            NavigationHistory.Add(navObj);
        }
Ejemplo n.º 4
0
        public async void ClearHistory()
        {
            while (_navigationHistory.Count > 1)
            {
                _navigationHistory.Pop();
                NavigationHistory.RemoveAt(0);
            }

            await SetPage();
        }
Ejemplo n.º 5
0
        public async void Back()
        {
            if (_navigationHistory.Count == 1)
            {
                return;
            }

            _navigationHistory.Pop();
            NavigationHistory.RemoveAt(0);
            if (_navigationHistory.Count == 1)
            {
                try
                {
                    await _jiraApi.Session.Logout();
                }
                catch (IncompleteJiraConfiguration)
                { }
            }
            await SetPage();
        }
Ejemplo n.º 6
0
        private async void BackToPage(NavigationHistoryEntry entry)
        {
            if (entry.Page.Title.Contains("Log out"))
            {
                await _jiraApi.Session.Logout();
            }

            if (_navigationHistory.Peek() == entry.Page)
            {
                return;
            }

            while (_navigationHistory.Peek() != entry.Page)
            {
                _navigationHistory.Pop();
                NavigationHistory.RemoveAt(0);
            }

            await SetPage();
        }