예제 #1
0
 public void IntellicodeDisplayInfopop(InfopopCollection entries)
 {
     __IntellicodeDisplayInfopop(entries);
 }
예제 #2
0
 public void IntellicodeDisplayInfopop(InfopopCollection entries)
 {
     __IntellicodeDisplayInfopop(entries);
 }
예제 #3
0
        private InfopopCollection GetCustomInfopopUser(string function)
        {
            // Check user-defined function definitions

            InfopopCollection ipc = new InfopopCollection();
            foreach(CProject.File file in g.Project.FileList) {
                if (!file.TokenList.ContainsKey(function.ToLower()))
                    continue;

                CProject.TokenKey token = (CProject.TokenKey)file.TokenList[function.ToLower()];

                string paramlist = "";
                if (token.FuncParams == null)
                    paramlist = "void";
                else
                    paramlist = String.Join(", ", token.FuncParams);

                string infotip = "<b>" + token.FuncName + "</b> (<i>" + paramlist + "</i>)" +
                    ((token.FuncDescr == "") ? "" : "<br/>" + token.FuncDescr) +
                    "<br/><span style=\"font-size: 7pt\">" +
                    "Defined in " + file.RelativePath + "." +
                    "</span>";

                ipc.Add(new Infopop(token.FuncName, paramlist, "", token.FuncDescr, infotip));

                // Run through all the plugins
                /*if (frmMain.stc_Plugins.Count > 0) {
                    foreach(IPlugin plugin in frmMain.stc_Plugins)
                        plugin.onBeforeDisplayInfopop(ipc, token.FuncName, "", "", false);
                }*/
            }

            return ipc;
        }
예제 #4
0
        private InfopopCollection GetCustomInfopopBuiltin(string function)
        {
            // Check the built-in function list
            if (!ac.HasParamObject(function.ToLower()))
                return new InfopopCollection();

            CAutoComplete.ACEntry acentry = ac.ReturnParamObject(function.ToLower());
            InfopopCollection ipc = new InfopopCollection();

            //string[] output = new string[acentry.FormattedParameters.Count];

            for (int i = 0; i < acentry.FormattedName.Count; i++) {
                string infotip = acentry.FormattedName[i].ToString() + " (" +
                    acentry.FormattedParameters[i].ToString() + ")<br/>" +
                    acentry.FormattedDescription[i].ToString();

                //output[i] = infotip;

                // Create the infopop collection
                ipc.Add(new Infopop(acentry.UnformattedName[i].ToString(), acentry.UnformattedParameters[i].ToString(),
                    "", acentry.UnformattedDescription[i].ToString(), infotip));
            }

            // Execute some functions for the plugin:
            /*if (frmMain.stc_Plugins.Count > 0) {
                foreach(IPlugin plugin in frmMain.stc_Plugins)
                    plugin.onBeforeDisplayInfopop(ipc, function, "", "", true);
            }*/

            //return output;
            return ipc;
        }
예제 #5
0
        private InfopopCollection GetVarInfopop(string variable, string function, int var_type, int startpos)
        {
            CAutoComplete.ClassEntry cls = GetObjDeclare(startpos, variable);

            if (cls == null)
                return new InfopopCollection();

            if (!cls.func_list.ContainsKey(function.ToLower()))
                return new InfopopCollection();

            InfopopCollection ipc = new InfopopCollection();

            CAutoComplete.ClassEntry.FuncEntry func = (CAutoComplete.ClassEntry.FuncEntry)cls.func_list[function.ToLower()];
            string infotip = "[" + cls.ClassName + "] <u>" + func.func_ret + "</u> <b>" + func.func_name + "</b> " +
                "(<i>" + func.func_params.Replace("<", "&lt;") + "</i>)" +
                ((func.func_descr == "") ? "" : "<br/>" + func.func_descr);

            ipc.Add(new Infopop(func.func_name, func.func_params, func.func_ret, func.func_descr, infotip));

            /*if (frmMain.stc_Plugins.Count > 0) {
                foreach(IPlugin plugin in frmMain.stc_Plugins)
                    plugin.onBeforeDisplayInfopop(ipc, function, "", variable, false);
            }*/

            return ipc;
        }
예제 #6
0
        private InfopopCollection GetObjectInfopop(string obj, string function)
        {
            InfopopCollection ipc = new InfopopCollection();

            if (!g.Project.TokenObjList.ContainsKey(obj.ToLower()))
                return ipc;

            CProject.TokenObject tokobj = (CProject.TokenObject)g.Project.TokenObjList[obj.ToLower()];

            string infotip = "";

            if (tokobj.ObjectFunctions.ContainsKey(function.ToLower())) {
                // Check user-defined object functions first
                CProject.TokenObject.ObjectDescr func = (CProject.TokenObject.ObjectDescr)tokobj.ObjectFunctions[function.ToLower()];
                string paramlist = "";

                if (func.FuncParams == null || func.FuncParams.Length == 0)
                    paramlist = "void";
                else
                    paramlist = String.Join(", ", func.FuncParams);

                infotip = tokobj.ObjectName + "::<b>" + func.FuncName + "</b> (<i>" +
                    paramlist + "</i>)" +
                    ((func.FuncDescr == "") ? "" : "<br/>" + func.FuncDescr) +
                    "<br/><span style=\"font-size: 7pt\">" +
                    "Defined in " + func.FuncFile.RelativePath + "." +
                    "</span>";

                ipc.Add(new Infopop(func.FuncName, paramlist, "", func.FuncDescr, infotip));

                // PLUGINS
                /*foreach (CWPlugin plugin in g.Plugins) {
                    try {
                        plugin.Plugin.CWBeforeDisplayInfopop(this.g_curFile.ToCWFile(), ref ipc);
                    } catch (Exception exc) {
                        g.PluginException(exc, plugin);
                    }
                }*/

            } else {
                // Check built-in object functions next
                if (tokobj.ObjectType == null)
                    return ipc;

                if (!ac.HasClassObject(tokobj.ObjectType.ToLower()))
                    return ipc;

                CAutoComplete.ClassEntry cls = ac.ReturnClassObject(tokobj.ObjectType.ToLower());

                if (!cls.func_list.ContainsKey(function.ToLower()))
                    return ipc;

                CAutoComplete.ClassEntry.FuncEntry func = (CAutoComplete.ClassEntry.FuncEntry)cls.func_list[function.ToLower()];

                infotip = "<u>" + func.func_ret + "</u> <b>" + func.func_name + "</b>" +
                    " (<i>" + func.func_params.Replace("<", "&lt;") + "</i>)" +
                    ((func.func_descr == "") ? "" : "<br/> " + func.func_descr);

                ipc.Add(new Infopop(func.func_name, func.func_params, func.func_ret, func.func_descr, infotip));

                // PLUGINS
                /*foreach (CWPlugin plugin in g.Plugins) {
                    try {
                        plugin.Plugin.CWBeforeDisplayInfopop(g_curFile.ToCWFile(), ref ipc);
                    } catch (Exception exc) {
                        g.PluginException(exc, plugin);
                    }
                }*/
                /*if (frmMain.stc_Plugins.Count > 0) {
                    foreach(IPlugin plugin in frmMain.stc_Plugins)
                        plugin.onBeforeDisplayInfopop(ipc, function, obj, "", true);
                }*/
            }

            return ipc;
        }
예제 #7
0
        public static void IntellicodeDisplayInfopop(InfopopCollection entries)
        {
            // Is an editor window active?
            if (g.Main.GetActiveEditor() == null)
                return;

            UCEditor editor = g.Main.GetActiveEditor();
            editor.txtEditor.IntelliPrompt.InfoTip.Info.Clear();

            // Display it
            foreach (Infopop info in entries) {
                editor.txtEditor.IntelliPrompt.InfoTip.Info.Add(
                    "<b><u>" + info.InfopopRetType.Replace("<", "&lt;") + "</b></u> " +
                    "<b>" + info.InfopopName.Replace("<", "&lt;") + "</b> " +
                    "(<i>" + info.InfopopParams.Replace("<", "&lt;") + "</i>) " +
                    ((info.InfopopDescr.Trim() != "") ? "<br />" + info.InfopopDescr.Replace("<", "&lt;") : "")
                );
            }

            editor.txtEditor.IntelliPrompt.InfoTip.Show(editor.txtEditor.SelectedView.Selection.StartOffset);
        }