Ejemplo n.º 1
0
        public void TryImportMissingSymbol()
        {
            DModule n;
            var     nodesToChooseFrom = GetImportableModulesForLastResults();

            var count = nodesToChooseFrom.Count();

            if (count == 0)
            {
                return;
            }

            if (count == 1)
            {
                n = nodesToChooseFrom.First();
            }
            else
            {
                n = ImportSymbolSelectionDlg.Show(nodesToChooseFrom, GettextCatalog.GetString("Select symbol"));
            }

            if (n != null)
            {
                ImportStmtCreation.GenerateImportStatementForNode(n, ed, new TextDocumentAdapter(IdeApp.Workbench.ActiveDocument.Editor));
            }
        }
Ejemplo n.º 2
0
        AbstractType GetResult()
        {
            if (lastResults.Length == 1)
            {
                return(lastResults [0]);
            }

            return(ImportSymbolSelectionDlg.Show(lastResults, GettextCatalog.GetString("Select symbol"),
                                                 (object o) => o is DSymbol ? (o as DSymbol).Definition.ToString(false, true) : o.ToString()));
        }
Ejemplo n.º 3
0
            public override INode HandleMultipleResults(INode[] results)
            {
                var dlg = new ImportSymbolSelectionDlg(results);

                if(MessageService.RunCustomDialog(dlg, Ide.IdeApp.Workbench.RootWindow) != (int)ResponseType.Ok)
                    return null;

                var n = dlg.SelectedNode;
                dlg.Destroy();
                return n;
            }
Ejemplo n.º 4
0
            public override INode HandleMultipleResults(INode[] results)
            {
                var dlg = new ImportSymbolSelectionDlg(results);

                if (MessageService.RunCustomDialog(dlg, Ide.IdeApp.Workbench.RootWindow) != (int)ResponseType.Ok)
                {
                    return(null);
                }

                var n = dlg.SelectedNode;

                dlg.Destroy();
                return(n);
            }