Example #1
0
 public new void Hide()
 {
     if (descriptionWindow != null)
     {
         descriptionWindow.Destroy();
         descriptionWindow = null;
     }
     agent.Hide();
 }
        void HideDescription()
        {
            Runtime.CheckMainThread();

            descriptionCts.Cancel();
            descriptionCts = new CancellationTokenSource();

            if (descriptionWindow != null)
            {
                descriptionWindow.Destroy();
                descriptionWindow = null;
            }
        }
Example #3
0
        private async Task UpdateDescription()
        {
            if (descriptionWindow != null)
            {
                descriptionWindow.Destroy();
                descriptionWindow = null;
            }
            descriptionCts.Cancel();
            if (SelectedItemIndex == -1)
            {
                return;
            }
            var completionItem = SelectedItem;

            descriptionCts = new CancellationTokenSource();
            var token = descriptionCts.Token;


            TooltipInformation description = null;

            try {
                var document = _subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChangesSafe();
                description = await RoslynCompletionData.CreateTooltipInformation(document, completionItem, false, token);
            } catch {
            }
            if (token.IsCancellationRequested)
            {
                return;
            }
            if (descriptionWindow != null)
            {
                descriptionWindow.Destroy();
                descriptionWindow = null;
            }
            if (description == null)
            {
                return;
            }
            var window = new TooltipInformationWindow();

            window.AddOverload(description);
            descriptionWindow = window;
            ShowDescription();
        }
        void ShowDescription(TooltipInformation description)
        {
            HideDescription();

            if (description == null)
            {
                return;
            }

            var window = new TooltipInformationWindow();

            window.AddOverload(description);
            descriptionWindow = window;
            var rect = GetRowArea(SelectedItemIndex);
            int y    = rect.Y + Theme.Padding - (int)vadj.Value;

            descriptionWindow.ShowPopup(this, new Gdk.Rectangle(0, Math.Min(Allocation.Height, Math.Max(0, y)), Allocation.Width, rect.Height), PopupPosition.Left);
            descriptionWindow.Show();
        }