Ejemplo n.º 1
0
        static Window CreatePackageWindow(InfoItem infoItem)
        {
            var window = new TooltipInformationWindow();

            window.ShowArrow = true;
            window.RepositionWindow();

            var cts = new CancellationTokenSource();

            window.Closed += delegate { cts.Cancel(); };

            var packages = infoItem.Packages;
            TooltipInformation ti;
            bool done = CreatePackageTooltipInfo((string)infoItem.ResolveResult.Reference, packages, out ti);

            if (!done)
            {
                packages.ContinueWith(t => {
                    if (!done)
                    {
                        done = CreatePackageTooltipInfo((string)infoItem.ResolveResult.Reference, packages, out ti);
                        if (ti != null)
                        {
                            window.Clear();
                            window.AddOverload(ti);
                        }
                    }
                }, cts.Token, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
            }

            window.AddOverload(ti);
            return(window);
        }
Ejemplo n.º 2
0
        protected override Gtk.Window CreateTooltipWindow(Mono.TextEditor.TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
        {
            var doc = IdeApp.Workbench.ActiveDocument;

            if (doc == null)
            {
                return(null);
            }

            var titem = (ToolTipData)item.Item;

            var tooltipInformation = CreateTooltip(titem, offset, null, modifierState);

            if (tooltipInformation == null || string.IsNullOrEmpty(tooltipInformation.SignatureMarkup))
            {
                return(null);
            }

            var result = new TooltipInformationWindow();

            result.ShowArrow = true;
            result.AddOverload(tooltipInformation);
            result.RepositionWindow();
            return(result);
        }
        public override Window CreateTooltipWindow(
            TextEditor editor,
            DocumentContext ctx,
            TooltipItem item,
            int offset,
            Xwt.ModifierKeys modifierState)
        {
            var result = new TooltipInformationWindow();

            result.ShowArrow = true;
            result.AddOverload((TooltipInformation)item.Item);
            result.RepositionWindow();

            return(result);
        }
        public override Components.Window CreateTooltipWindow(Ide.Editor.TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
        {
            var doc = ctx;

            if (doc == null)
            {
                return(null);
            }

            var result = new TooltipInformationWindow();

            result.ShowArrow = true;
            result.AddOverload((TooltipInformation)item.Item);
            result.RepositionWindow();
            return(result);
        }
Ejemplo n.º 5
0
        static Window CreateItemWindow(InfoItem infoItem)
        {
            TooltipInformation ti = null;

            ti = CreateTooltipInformation(infoItem.Doc, infoItem.Info, infoItem.ResolveResult);
            if (ti == null)
            {
                return(null);
            }

            var window = new TooltipInformationWindow();

            window.AddOverload(ti);
            window.ShowArrow = true;
            window.RepositionWindow();
            return(window);
        }
Ejemplo n.º 6
0
        protected override Window CreateTooltipWindow(TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
        {
            var doc = IdeApp.Workbench.ActiveDocument;

            if (doc == null)
            {
                return(null);
            }

            var titem = item.Item as AbstractType;

            if (titem == null)
            {
                return(null);
            }

            var result = new TooltipInformationWindow();

            result.ShowArrow = true;

            foreach (var i in AmbiguousType.TryDissolve(titem))
            {
                if (i == null)
                {
                    continue;
                }
                var tooltipInformation = TooltipInfoGen.Create(i, editor.ColorStyle);
                if (tooltipInformation != null && !string.IsNullOrEmpty(tooltipInformation.SignatureMarkup))
                {
                    result.AddOverload(tooltipInformation);
                }
            }

            if (result.Overloads < 1)
            {
                result.Dispose();
                return(null);
            }

            result.RepositionWindow();
            return(result);
        }
Ejemplo n.º 7
0
        public override Control CreateTooltipWindow(TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Gdk.ModifierType modifierState)
        {
            var doc = ctx;

            if (doc == null)
            {
                return(null);
            }

            var titem = (ToolTipData)item.Item;

            var tooltipInformation = CreateTooltip(titem, editor, ctx, offset, modifierState);

            if (tooltipInformation == null || string.IsNullOrEmpty(tooltipInformation.SignatureMarkup))
            {
                return(null);
            }
            var result = new TooltipInformationWindow();

            result.ShowArrow = true;
            result.AddOverload(tooltipInformation);
            result.RepositionWindow();
            return(result);
        }