protected override void Run()
        {
            MonoDevelop.Ide.Gui.Document doc = IdeApp.Workbench.ActiveDocument;
            HighlightUsagesExtension     ext = MoveToPrevUsageHandler.GetHighlightUsageExtension(doc);

            if (ext == null)
            {
                return;
            }
            if (ext.IsTimerOnQueue)
            {
                ext.ForceUpdate();
            }
            if (ext == null || ext.Markers.Count == 0)
            {
                return;
            }

            var caretOffset = doc.Editor.CaretOffset;

            for (int i = 0; i < ext.Markers.Count; i++)
            {
                if (ext.Markers [i].Contains(caretOffset))
                {
                    MoveToNextUsageHandler.MoveToSegment(doc, ext.Markers [(i + 1) % ext.Markers.Count]);
                }
            }
        }
        protected override void Run()
        {
            MonoDevelop.Ide.Gui.Document doc = IdeApp.Workbench.ActiveDocument;
            HighlightUsagesExtension     ext = MoveToPrevUsageHandler.GetHighlightUsageExtension(doc);

            if (ext == null)
            {
                return;
            }
            if (ext.IsTimerOnQueue)
            {
                ext.ForceUpdate();
            }
            if (ext == null || ext.Markers.Count == 0)
            {
                return;
            }

            if (ext.Markers.ContainsKey(doc.Editor.Caret.Line))
            {
                var      marker  = ext.Markers[doc.Editor.Caret.Line];
                ISegment segment = null;
                for (int i = 0; i < marker.Usages.Count; i++)
                {
                    if (marker.Usages[i].Offset > doc.Editor.Caret.Offset)
                    {
                        segment = marker.Usages[i];
                        break;
                    }
                }
                if (segment != null)
                {
                    MoveToSegment(doc, segment);
                    return;
                }
            }

            int max = int.MinValue;

            foreach (var pair in ext.Markers)
            {
                if (pair.Key > doc.Editor.Caret.Line)
                {
                    max = pair.Key;
                    break;
                }
            }

            if (max >= 0)
            {
                MoveToSegment(doc, ext.Markers[max].Usages.First());
                return;
            }
            MoveToSegment(doc, ext.Markers.First().Value.Usages.First());
        }