Example #1
0
        public void NavigateBackward()
        {
            if (!CanNavigateBackward)
            {
                return;
            }

            _forwardStack.Push(_currentLocation);
            _currentLocation = _backwardStack.Pop();
            NavigateTo(_currentLocation);
        }
Example #2
0
        private void NavigateTo(NavigationLocation location)
        {
            ModelsExplorer.Instance.OpenFile(location.FilePath);

            if (ASContext.CurSciControl != null &&
                ASContext.Context != null &&
                ASContext.Context.CurrentFile == location.FilePath)
            {
                ASContext.CurSciControl.GotoPos(location.Position);
            }

            OnLocationChanged();
        }
Example #3
0
        private void AddCurrentLocation()
        {
            if (CanNavigateForward)
            {
                _forwardStack.Clear();
            }

            _backwardStack.Push(_currentLocation);

            _currentLocation = GetCurrentLocation();

            OnLocationChanged();
        }
Example #4
0
        private void timer_Tick(object sender, EventArgs e)
        {
            _updateTimer.Stop();

            if (HasLocationChanged)
            {
                if (_currentLocation != null)
                {
                    AddCurrentLocation();
                }
                else
                {
                    _currentLocation = GetCurrentLocation();
                }
            }

            _updateTimer.Start();
        }
Example #5
0
        private NavigationLocation GetCurrentLocation()
        {
            NavigationLocation location = new NavigationLocation();

            if (ASContext.CurSciControl == null || ASContext.HasContext == false)
            {
                return(null);
            }

            string currentClass  = ASContext.Context.CurrentClass == null ? string.Empty : ASContext.Context.CurrentClass.Name;
            string currentMember = ASContext.Context.CurrentMember == null ? string.Empty : ASContext.Context.CurrentMember.Name;

            location.FilePath    = ASContext.Context.CurrentFile;
            location.ClassName   = currentClass;
            location.MemberName  = currentMember;
            location.MemberFlags = string.IsNullOrEmpty(currentMember) ? FlagType.Class : ASContext.Context.CurrentMember.Flags;
            location.LineFrom    = ASContext.Context.CurrentLine;
            location.Position    = ASContext.CurSciControl.CurrentPos;

            return(location);
        }
        private void timer_Tick(object sender, EventArgs e)
        {
            _updateTimer.Stop();

            if (HasLocationChanged)
                if (_currentLocation != null)
                    AddCurrentLocation();
                else
                    _currentLocation = GetCurrentLocation();

            _updateTimer.Start();
        }
        private void NavigateTo(NavigationLocation location)
        {
            ModelsExplorer.Instance.OpenFile(location.FilePath);

            if (ASContext.CurSciControl != null &&
                ASContext.Context != null &&
                ASContext.Context.CurrentFile == location.FilePath)
            {
                ASContext.CurSciControl.GotoPos(location.Position);
            }

            OnLocationChanged();
        }
        private NavigationLocation GetCurrentLocation()
        {
            NavigationLocation location = new NavigationLocation();

            if (ASContext.CurSciControl == null || ASContext.HasContext == false)
                return null;

            string currentClass = ASContext.Context.CurrentClass == null ? string.Empty : ASContext.Context.CurrentClass.Name;
            string currentMember = ASContext.Context.CurrentMember == null ? string.Empty : ASContext.Context.CurrentMember.Name;

            location.FilePath = ASContext.Context.CurrentFile;
            location.ClassName = currentClass;
            location.MemberName = currentMember;
            location.MemberFlags = string.IsNullOrEmpty(currentMember) ? FlagType.Class : ASContext.Context.CurrentMember.Flags;
            location.LineFrom = ASContext.Context.CurrentLine;
            location.Position = ASContext.CurSciControl.CurrentPos;

            return location;
        }
        private void AddCurrentLocation()
        {
            if (CanNavigateForward)
                _forwardStack.Clear();

            var lastLocation = _currentLocation;
            _currentLocation = GetCurrentLocation();

            // Is a new member name being typed?
            if ((lastLocation.FilePath == _currentLocation.FilePath &&
                lastLocation.LineFrom == _currentLocation.LineFrom) ||
                lastLocation.MemberName == _currentLocation.MemberName)
                return;

            if (!string.IsNullOrEmpty(_currentLocation.MemberName))
                _backwardStack.Push(lastLocation);

            OnLocationChanged();
        }
 internal void NavigateForwardTo(NavigationLocation location)
 {
     while (_currentLocation != location)
     {
         _backwardStack.Push(_currentLocation);
         _currentLocation = _forwardStack.Pop();
     }
     NavigateTo(_currentLocation);
 }
        public void NavigateForward()
        {
            if (!CanNavigateForward)
                return;

            _backwardStack.Push(_currentLocation);
            _currentLocation = _forwardStack.Pop();
            NavigateTo(_currentLocation);
        }