private void AddWithoutDuplicationCheck(string name, string fullname, string datatype, int imageIndex) { string preText = MaskIdentifier(name); string description = String.Format(CultureInfo.CurrentCulture, "<b>{0}</b> : {1}", fullname, datatype); IntelliPromptMemberListItem item = new IntelliPromptMemberListItem(name, imageIndex, description, preText, String.Empty); _members.Add(item); }
protected override void OnSyntaxEditorTriggerActivated(ActiproSoftware.SyntaxEditor.SyntaxEditor syntaxEditor, TriggerEventArgs e) { string str = e.get_Trigger().get_Key(); if ((str != null) && (str == "XMLCommentTagListTrigger")) { IntelliPromptMemberList list = syntaxEditor.get_IntelliPrompt().get_MemberList(); list.ResetAllowedCharacters(); list.set_ImageList(ActiproSoftware.SyntaxEditor.SyntaxEditor.get_ReflectionImageList()); list.Clear(); list.Add(new IntelliPromptMemberListItem("c", 0x33, "Indicates that text within the tag should be marked as code. Use <code> to indicate multiple lines as code.")); list.Add(new IntelliPromptMemberListItem("code", 0x33, "Indicates multiple lines as code. Use <c> to indicate that text within a description should be marked as code.")); list.Add(new IntelliPromptMemberListItem("example", 0x33, "Specifies an example of how to use a method or other library member.")); list.Add(new IntelliPromptMemberListItem("exception", 0x33, "Specifies which exceptions a class can throw.", "exception cref=\"", "\"")); list.Add(new IntelliPromptMemberListItem("include", 0x33, "Refers to comments in another file that describe the types and members in your source code.", "include file='", "' path='[@name=\"\"]'/>")); list.Add(new IntelliPromptMemberListItem("list", 0x33, "Provides a container for list items.", "list type=\"", "\"")); list.Add(new IntelliPromptMemberListItem("listheader", 0x33, "Defines the heading row of either a table or definition list.")); list.Add(new IntelliPromptMemberListItem("item", 0x33, "Defines an item in a table or definition list.")); list.Add(new IntelliPromptMemberListItem("term", 0x33, "A term to define, which will be defined in text.")); list.Add(new IntelliPromptMemberListItem("description", 0x33, "Either an item in a bullet or numbered list or the definition of a term.")); list.Add(new IntelliPromptMemberListItem("para", 0x33, "Provides a paragraph container.")); list.Add(new IntelliPromptMemberListItem("param", 0x33, "Describes one of the parameters for the method.", "param name=\"", "\"/>")); list.Add(new IntelliPromptMemberListItem("paramref", 0x33, "Indicates that a word is a parameter.", "paramref name=\"", "\"/>")); list.Add(new IntelliPromptMemberListItem("permission", 0x33, "Documents the access of a member.", "permission cref=\"", "\"")); list.Add(new IntelliPromptMemberListItem("remarks", 0x33, "Specifies overview information about a class or other type.")); list.Add(new IntelliPromptMemberListItem("returns", 0x33, "Describes the return value for a method declaration.")); list.Add(new IntelliPromptMemberListItem("see", 0x33, "Specifies a link from within text.", "see cref=\"", "\"/>")); list.Add(new IntelliPromptMemberListItem("seealso", 0x33, "Specifies the text that you might want to appear in a See Also section.", "seealso cref=\"", "\"/>")); list.Add(new IntelliPromptMemberListItem("summary", 0x33, "Describes a member for a type.")); list.Add(new IntelliPromptMemberListItem("value", 0x33, "Describes the value for a property declaration.")); if (list.get_Count() > 0) { list.Show(); } } }
protected override void OnSyntaxEditorTriggerActivated(ActiproSoftware.SyntaxEditor.SyntaxEditor syntaxEditor, TriggerEventArgs e) { string str = e.get_Trigger().get_Key(); if (str != null) { if (!(str == "TagAutoCompleteTrigger")) { if (str == "TagListTrigger") { IntelliPromptMemberList list = syntaxEditor.get_IntelliPrompt().get_MemberList(); list.ResetAllowedCharacters(); list.set_ImageList(ActiproSoftware.SyntaxEditor.SyntaxEditor.get_ReflectionImageList()); list.Clear(); list.Add(new IntelliPromptMemberListItem("<!-- -->", 0x2d, null, "!-- ", " -->")); list.Add(new IntelliPromptMemberListItem("a", 0x2b)); list.Add(new IntelliPromptMemberListItem("acronym", 0x2b)); list.Add(new IntelliPromptMemberListItem("address", 0x2b)); list.Add(new IntelliPromptMemberListItem("applet", 0x2b)); list.Add(new IntelliPromptMemberListItem("area", 0x2b)); list.Add(new IntelliPromptMemberListItem("b", 0x2b)); list.Add(new IntelliPromptMemberListItem("base", 0x2b)); list.Add(new IntelliPromptMemberListItem("basefont", 0x2b)); list.Add(new IntelliPromptMemberListItem("bdo", 0x2b)); list.Add(new IntelliPromptMemberListItem("bgsound", 0x2b)); list.Add(new IntelliPromptMemberListItem("big", 0x2b)); list.Add(new IntelliPromptMemberListItem("blockquote", 0x2b)); list.Add(new IntelliPromptMemberListItem("body", 0x2b)); list.Add(new IntelliPromptMemberListItem("br", 0x2b)); list.Add(new IntelliPromptMemberListItem("button", 0x2b)); list.Add(new IntelliPromptMemberListItem("caption", 0x2b)); list.Add(new IntelliPromptMemberListItem("center", 0x2b)); list.Add(new IntelliPromptMemberListItem("cite", 0x2b)); list.Add(new IntelliPromptMemberListItem("code", 0x2b)); list.Add(new IntelliPromptMemberListItem("col", 0x2b)); list.Add(new IntelliPromptMemberListItem("colgroup", 0x2b)); list.Add(new IntelliPromptMemberListItem("dd", 0x2b)); list.Add(new IntelliPromptMemberListItem("del", 0x2b)); list.Add(new IntelliPromptMemberListItem("dfn", 0x2b)); list.Add(new IntelliPromptMemberListItem("dir", 0x2b)); list.Add(new IntelliPromptMemberListItem("div", 0x2b)); list.Add(new IntelliPromptMemberListItem("dl", 0x2b)); list.Add(new IntelliPromptMemberListItem("dt", 0x2b)); list.Add(new IntelliPromptMemberListItem("em", 0x2b)); list.Add(new IntelliPromptMemberListItem("embed", 0x2b)); list.Add(new IntelliPromptMemberListItem("fieldset", 0x2b)); list.Add(new IntelliPromptMemberListItem("form", 0x2b)); list.Add(new IntelliPromptMemberListItem("frame", 0x2b)); list.Add(new IntelliPromptMemberListItem("frameset", 0x2b)); list.Add(new IntelliPromptMemberListItem("h1", 0x2b)); list.Add(new IntelliPromptMemberListItem("h2", 0x2b)); list.Add(new IntelliPromptMemberListItem("h3", 0x2b)); list.Add(new IntelliPromptMemberListItem("h4", 0x2b)); list.Add(new IntelliPromptMemberListItem("h5", 0x2b)); list.Add(new IntelliPromptMemberListItem("h6", 0x2b)); list.Add(new IntelliPromptMemberListItem("head", 0x2b)); list.Add(new IntelliPromptMemberListItem("hr", 0x2b)); list.Add(new IntelliPromptMemberListItem("html", 0x2b)); list.Add(new IntelliPromptMemberListItem("i", 0x2b)); list.Add(new IntelliPromptMemberListItem("iframe", 0x2b)); list.Add(new IntelliPromptMemberListItem("img", 0x2b)); list.Add(new IntelliPromptMemberListItem("input", 0x2b)); list.Add(new IntelliPromptMemberListItem("ins", 0x2b)); list.Add(new IntelliPromptMemberListItem("isindex", 0x2b)); list.Add(new IntelliPromptMemberListItem("kbd", 0x2b)); list.Add(new IntelliPromptMemberListItem("label", 0x2b)); list.Add(new IntelliPromptMemberListItem("legend", 0x2b)); list.Add(new IntelliPromptMemberListItem("li", 0x2b)); list.Add(new IntelliPromptMemberListItem("link", 0x2b)); list.Add(new IntelliPromptMemberListItem("listing", 0x2b)); list.Add(new IntelliPromptMemberListItem("map", 0x2b)); list.Add(new IntelliPromptMemberListItem("marquee", 0x2b)); list.Add(new IntelliPromptMemberListItem("menu", 0x2b)); list.Add(new IntelliPromptMemberListItem("meta", 0x2b)); list.Add(new IntelliPromptMemberListItem("nobr", 0x2b)); list.Add(new IntelliPromptMemberListItem("noframes", 0x2b)); list.Add(new IntelliPromptMemberListItem("noscript", 0x2b)); list.Add(new IntelliPromptMemberListItem("object", 0x2b)); list.Add(new IntelliPromptMemberListItem("ol", 0x2b)); list.Add(new IntelliPromptMemberListItem("option", 0x2b)); list.Add(new IntelliPromptMemberListItem("p", 0x2b)); list.Add(new IntelliPromptMemberListItem("param", 0x2b)); list.Add(new IntelliPromptMemberListItem("plaintext", 0x2b)); list.Add(new IntelliPromptMemberListItem("pre", 0x2b)); list.Add(new IntelliPromptMemberListItem("q", 0x2b)); list.Add(new IntelliPromptMemberListItem("s", 0x2b)); list.Add(new IntelliPromptMemberListItem("samp", 0x2b)); list.Add(new IntelliPromptMemberListItem("script", 0x2b)); list.Add(new IntelliPromptMemberListItem("select", 0x2b)); list.Add(new IntelliPromptMemberListItem("small", 0x2b)); list.Add(new IntelliPromptMemberListItem("span", 0x2b)); list.Add(new IntelliPromptMemberListItem("strike", 0x2b)); list.Add(new IntelliPromptMemberListItem("strong", 0x2b)); list.Add(new IntelliPromptMemberListItem("style", 0x2b)); list.Add(new IntelliPromptMemberListItem("sub", 0x2b)); list.Add(new IntelliPromptMemberListItem("sup", 0x2b)); list.Add(new IntelliPromptMemberListItem("table", 0x2b)); list.Add(new IntelliPromptMemberListItem("tbody", 0x2b)); list.Add(new IntelliPromptMemberListItem("td", 0x2b)); list.Add(new IntelliPromptMemberListItem("textarea", 0x2b)); list.Add(new IntelliPromptMemberListItem("tfoot", 0x2b)); list.Add(new IntelliPromptMemberListItem("th", 0x2b)); list.Add(new IntelliPromptMemberListItem("thead", 0x2b)); list.Add(new IntelliPromptMemberListItem("title", 0x2b)); list.Add(new IntelliPromptMemberListItem("tr", 0x2b)); list.Add(new IntelliPromptMemberListItem("tt", 0x2b)); list.Add(new IntelliPromptMemberListItem("u", 0x2b)); list.Add(new IntelliPromptMemberListItem("ul", 0x2b)); list.Add(new IntelliPromptMemberListItem("var", 0x2b)); list.Add(new IntelliPromptMemberListItem("xml", 0x2b)); list.Add(new IntelliPromptMemberListItem("xmp", 0x2b)); if (list.get_Count() > 0) { list.Show(); } } } else { base.OnSyntaxEditorTriggerActivated(syntaxEditor, e); } } }
private void PopulateMemList(IntelliPromptMemberList ml) { /* * iec.Add(new IntellicodeEntry(func.func_name, "<u>" + func.func_ret + "</u> <b>" + func.func_name + "</b> (<i>" + func.func_params.Replace("<", "<") + "</i>)" + ((func.func_descr == "") ? "" : "<br />" + func.func_descr), Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.PublicMethod), func.func_name, "")); */ // Grab all the functions in the project foreach (CProject.File file in g.Project.FileList) { foreach (CProject.TokenKey tok in file.TokenList.Values) { ml.Add(new IntelliPromptMemberListItem( tok.FuncName, Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.InternalMethod), "<b>" + tok.FuncName + "</b> (<i>" + String.Join(", ", tok.FuncParams).Replace("<", "<") + "</i>)" + ((tok.FuncDescr == null || tok.FuncDescr == "") ? "" : "<br />" + tok.FuncDescr), tok.FuncName, "")); } } // Grab all the functions from the engine foreach (CAutoComplete.ACEntry ac in frmMain.ac.ReturnAll().Values) { ml.Add(new IntelliPromptMemberListItem( ac.UnformattedName[0].ToString(), Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.PublicMethod), "<b>" + ac.FormattedName[0].ToString() + "</b> (<i>" + ac.FormattedParameters[0].ToString() + "</i>)" + ((ac.FormattedDescription[0].ToString() != "") ? "<br />" + ac.FormattedDescription[0].ToString().Replace("<", "<") : ""), ac.UnformattedName[0].ToString(), "")); } // Grab all the custom objects defined foreach (CProject.TokenObject tokobj in g.Project.TokenObjList.Values) { ml.Add(new IntelliPromptMemberListItem( tokobj.ObjectName, Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.PrivateClass), "<b>class</b> " + tokobj.ObjectName + " " + ((tokobj.ObjectType != "") ? "(Inherits <u>" + tokobj.ObjectType + "</u>)" : ""), tokobj.ObjectName, "")); } // Grab all the variables thus far defined TextStream ts = txtEditor.Document.GetTextStream(txtEditor.SelectedView.CurrentDocumentLine.EndOffset); ArrayList donevars = new ArrayList(); while (ts.CurrentToken.Key != "FunctionStartToken") { if (!ts.GoToPreviousToken()) break; if (donevars.Contains(txtEditor.Document.GetTokenText(ts.CurrentToken))) continue; if (ts.CurrentToken.Key == "LocalVariableToken") { ml.Add(new IntelliPromptMemberListItem( txtEditor.Document.GetTokenText(ts.CurrentToken), Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.PrivateField), "Local Variable <b>" + txtEditor.Document.GetTokenText(ts.CurrentToken) + "</b>", txtEditor.Document.GetTokenText(ts.CurrentToken), "")); } else if (ts.CurrentToken.Key == "GlobalVariableToken") { ml.Add(new IntelliPromptMemberListItem( txtEditor.Document.GetTokenText(ts.CurrentToken), Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.PublicField), "Global Variable <b>" + txtEditor.Document.GetTokenText(ts.CurrentToken) + "</b>", txtEditor.Document.GetTokenText(ts.CurrentToken), "")); } donevars.Add(txtEditor.Document.GetTokenText(ts.CurrentToken)); } // Add some keywords and operators ml.Add(new IntelliPromptMemberListItem("function", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("for", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("if", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("break", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("default", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("switch", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("case", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("return", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("else", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("new", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("datablock", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("package", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("or", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("switch$", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("while", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("continue", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("true", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("false", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword))); ml.Add(new IntelliPromptMemberListItem("SPC", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Operator))); ml.Add(new IntelliPromptMemberListItem("TAB", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Operator))); ml.Add(new IntelliPromptMemberListItem("NL", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Operator))); ml.Add(new IntelliPromptMemberListItem("%", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Operator))); ml.Add(new IntelliPromptMemberListItem("$=", Convert.ToInt32(ActiproSoftware.Products.SyntaxEditor.IconResource.Operator))); }
/// <summary> /// Provides the core functionality to show an IntelliPrompt member list based on the current context in a <see cref="SyntaxEditor"/>. /// </summary> /// <param name="language">The <see cref="DotNetLanguage"/> to use for quick info formatting.</param> /// <param name="syntaxEditor">The <see cref="SyntaxEditor"/> that will display the IntelliPrompt member list.</param> /// <param name="completeWord">Whether to complete the word.</param> /// <returns> /// <c>true</c> if an auto-complete occurred or if a IntelliPrompt member list is displayed; otherwise, <c>false</c>. /// </returns> internal bool ShowIntelliPromptMemberList(DotNetLanguage language, SyntaxEditor syntaxEditor, SyntaxEditor toEditor, bool completeWord, string parameterName) { // Try and ensure the compilation unit is up-to-date SemanticParserService.WaitForParse(SemanticParserServiceRequest.GetParseHashKey(syntaxEditor.Document, syntaxEditor.Document)); // Get the context //DotNetContext context = this.GetContext(syntaxEditor, syntaxEditor.Caret.Offset, true, false); DotNetContext context = this.GetContext(syntaxEditor, syntaxEditor.Document.GetText(LineTerminator.Newline).Length - 1, true, false); // Initialize the member list IntelliPromptMemberList memberList = toEditor.IntelliPrompt.MemberList;// syntaxEditor.IntelliPrompt.MemberList; memberList.ResetAllowedCharacters(); memberList.Clear(); memberList.ImageList = SyntaxEditor.ReflectionImageList; memberList.Context = context; // GFH if (completeWord && context.InitializationTextRange.StartOffset >= 0) { string partialWord = syntaxEditor.Document.GetText(LineTerminator.Newline).Substring(context.InitializationTextRange.StartOffset, context.InitializationTextRange.Length); if (parameterName.StartsWith(partialWord)) { memberList.Add(new IntelliPromptMemberListItem(parameterName, (int)ActiproSoftware.Products.SyntaxEditor.IconResource.PrivateProperty)); } } // Get the member list items Hashtable memberListItemHashtable = new Hashtable(); switch (context.Type) { case DotNetContextType.AnyCode: // Fill with everything if (context.ProjectResolver != null) { // Fill with child namespace names in the global and imported namespaces //context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, null); //foreach (string namespaceName in context.ImportedNamespaces) // context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, namespaceName); //// Fill with the types in the global and imported namespaces //context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, null, DomBindingFlags.Default, true); //foreach (string namespaceName in context.ImportedNamespaces) // context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, namespaceName, DomBindingFlags.Default, true); // Fill with static members of parent types if ((context.TypeDeclarationNode != null) && (context.TypeDeclarationNode.DeclaringType is IDomType)) { context.ProjectResolver.AddMemberListItemsForDeclaringTypeMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TypeDeclarationNode.DeclaringType, DomBindingFlags.Static | DomBindingFlags.AllAccessTypes); } // Fill with nested types if (context.TypeDeclarationNode != null) { context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, DomBindingFlags.Default, true); } // Fill with members if in a member (pay attention to if member is instance or static) if (context.TypeDeclarationNode != null) { if (context.MemberDeclarationNode != null) { if (!((IDomMember)context.MemberDeclarationNode).IsStatic) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, context.TypeDeclarationNode, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } // Fill with members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Static | (((IDomMember)context.MemberDeclarationNode).IsStatic ? DomBindingFlags.None : DomBindingFlags.Instance) | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } else { // Not within a member so fill with static members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Static | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } } // Fill with variables defined in the scope context.ProjectResolver.AddMemberListItemsForVariables(memberListItemHashtable, context); // Fill with language keywords //this.AddKeywordMemberListItems(memberListItemHashtable); // Fill with code snippets if (this.CodeSnippetsEnabled) { context.ProjectResolver.AddMemberListItemsForCodeSnippets(memberListItemHashtable); } } break; case DotNetContextType.BaseAccess: // If the context is in an instance member declaration... if ((context.ProjectResolver != null) && (context.MemberDeclarationNode != null) && (!((IDomMember)context.MemberDeclarationNode).IsStatic)) { if (context.TargetItem.Type == DotNetContextItemType.Base) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.Public | DomBindingFlags.Family | DomBindingFlags.Assembly); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.Public | DomBindingFlags.Family | DomBindingFlags.Assembly); } } break; case DotNetContextType.DocumentationCommentTag: // Add tags if (context.ProjectResolver != null) { context.ProjectResolver.AddMemberListItemsForDocumentationComments(memberListItemHashtable, context, (syntaxEditor.Caret.Offset > 0) && (syntaxEditor.Document[syntaxEditor.Caret.Offset - 1] != '<')); } break; case DotNetContextType.AsType: case DotNetContextType.IsTypeOfType: case DotNetContextType.TryCastType: case DotNetContextType.TypeOfType: if (context.ProjectResolver != null) { if (context.TargetItem != null) { switch (context.TargetItem.Type) { case DotNetContextItemType.Namespace: case DotNetContextItemType.NamespaceAlias: // Fill with child namespaces and types context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, context.TargetItem.ResolvedInfo.ToString()); context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TargetItem.ResolvedInfo.ToString(), DomBindingFlags.Default, false); break; case DotNetContextItemType.Type: // Fill with nested types context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Default, false); break; } } else { // VB requires New added for As specifications if ((context.Type == DotNetContextType.AsType) && (language == DotNetLanguage.VB)) { memberListItemHashtable["New"] = new IntelliPromptMemberListItem("New", (int)ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword); } // Fill with native types context.ProjectResolver.AddMemberListItemsForNativeTypes(language, memberListItemHashtable, context); // Fill with child namespace names in the global and imported namespaces context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, null); foreach (string namespaceName in context.ImportedNamespaces) { context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, namespaceName); } // Fill with the types in the imported namespaces context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, null, DomBindingFlags.Default, false); foreach (string namespaceName in context.ImportedNamespaces) { context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, namespaceName, DomBindingFlags.Default, false); } // Fill with nested types if (context.TypeDeclarationNode != null) { context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, DomBindingFlags.Default, true); } } } break; case DotNetContextType.NamespaceTypeOrMember: if (context.ProjectResolver != null) { switch (context.TargetItem.Type) { case DotNetContextItemType.Namespace: case DotNetContextItemType.NamespaceAlias: // Fill with child namespaces and types context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, context.TargetItem.ResolvedInfo.ToString()); context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TargetItem.ResolvedInfo.ToString(), DomBindingFlags.Default, false); break; case DotNetContextItemType.Constant: case DotNetContextItemType.Type: // Add nested types if (context.TargetItem.ResolvedInfo is IDomType) { // Fill with nested types context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Default, false); } // If the context is in a type declaration... if (context.TypeDeclarationNode != null) { // Fill with static type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Static | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } break; case DotNetContextItemType.Member: // If the context is in a type declaration... if (context.TypeDeclarationNode != null) { // Fill with instance type members of member return type IDomType type = context.ProjectResolver.ConstructAndResolveContextItemMemberReturnType(context, context.Items.Length - 1); if (type != null) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, type, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, type, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } } break; case DotNetContextItemType.ArrayItem: case DotNetContextItemType.Parameter: case DotNetContextItemType.Variable: // If the context is in a member declaration... if (context.MemberDeclarationNode != null) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } break; } } break; case DotNetContextType.NativeType: // If the context is in a member declaration... if ((context.ProjectResolver != null) && (context.TypeDeclarationNode != null)) { if (context.TargetItem.Type == DotNetContextItemType.Type) { // Fill with static type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Static | context.AdditionalBindingFlags | DomBindingFlags.Public); } } break; case DotNetContextType.NewObjectDeclaration: if ((context.ProjectResolver != null) && (context.TypeDeclarationNode != null)) { if (context.TargetItem == null) { // Fill with child namespace names in the global and imported namespaces context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, null); foreach (string namespaceName in context.ImportedNamespaces) { context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, namespaceName); } // Fill with the creatable types in the global and imported namespaces context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, null, DomBindingFlags.Default | DomBindingFlags.HasConstructor, false); foreach (string namespaceName in context.ImportedNamespaces) { context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, namespaceName, DomBindingFlags.Default | DomBindingFlags.HasConstructor, false); } // Fill with the creatable nested types context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TypeDeclarationNode, DomBindingFlags.Default | DomBindingFlags.HasConstructor, true); } else { switch (context.TargetItem.Type) { case DotNetContextItemType.Namespace: case DotNetContextItemType.NamespaceAlias: // Fill with child namespaces and creatable types context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, context.TargetItem.ResolvedInfo.ToString()); context.ProjectResolver.AddMemberListItemsForTypes(memberListItemHashtable, context.TypeDeclarationNode, context.TargetItem.ResolvedInfo.ToString(), DomBindingFlags.Default | DomBindingFlags.HasConstructor, false); break; case DotNetContextItemType.Type: // Fill with the creatable nested types context.ProjectResolver.AddMemberListItemsForNestedTypes(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Default | DomBindingFlags.HasConstructor, false); // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); break; } } } break; case DotNetContextType.ThisAccess: // If the context is in an instance member declaration... if ((context.ProjectResolver != null) && (context.MemberDeclarationNode != null) && (!((IDomMember)context.MemberDeclarationNode).IsStatic)) { if (context.TargetItem.Type == DotNetContextItemType.This) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } } break; case DotNetContextType.BaseMemberAccess: case DotNetContextType.ThisMemberAccess: // If the context is in an instance member declaration... if ((context.ProjectResolver != null) && (context.MemberDeclarationNode != null) && (!((IDomMember)context.MemberDeclarationNode).IsStatic)) { // Fill with instance type members of member return type IDomType type = null; if (context.TargetItem.ResolvedInfo is IDomType) { type = (IDomType)context.TargetItem.ResolvedInfo; } else { type = context.ProjectResolver.ConstructAndResolveContextItemMemberReturnType(context, context.Items.Length - 1); } if (type != null) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, type, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); // Fill with instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, type, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.AllAccessTypes); } } break; case DotNetContextType.StringLiteral: // If the context is in a member declaration... if (context.ProjectResolver != null) { if (context.TargetItem.Type == DotNetContextItemType.StringLiteral) { // Fill with extension methods context.ProjectResolver.AddMemberListItemsForExtensionMethods(memberListItemHashtable, context, (IDomType)context.TargetItem.ResolvedInfo, DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.Public); // Fill with string instance type members context.ProjectResolver.AddMemberListItemsForMembers(memberListItemHashtable, context.TypeDeclarationNode, (IDomType)context.TargetItem.ResolvedInfo, (this.LanguageType == DotNetLanguage.CSharp ? DomBindingFlags.ExcludeIndexers : DomBindingFlags.None) | DomBindingFlags.Instance | context.AdditionalBindingFlags | DomBindingFlags.Public); } } break; case DotNetContextType.UsingDeclaration: // Fill with namespaces if (context.ProjectResolver != null) { context.ProjectResolver.AddMemberListItemsForChildNamespaces(memberListItemHashtable, (context.TargetItem != null ? context.TargetItem.ResolvedInfo.ToString() : String.Empty)); } break; } // Pre-filter the member list this.OnSyntaxEditorIntelliPromptMemberListPreFilter(syntaxEditor, new IntelliPromptMemberListPreFilterEventArgs(syntaxEditor, context, memberListItemHashtable)); // Add items if (memberListItemHashtable.Count > 0) { IntelliPromptMemberListItem[] items = new IntelliPromptMemberListItem[memberListItemHashtable.Count]; memberListItemHashtable.Values.CopyTo(items, 0); memberList.AddRange(items); } // Show the list if (memberList.Count > 0) { if (context.InitializationTextRange.IsDeleted) { memberList.Show(); } else if (completeWord) { memberList.CompleteWord(toEditor.Caret.Offset - context.InitializationTextRange.Length, context.InitializationTextRange.Length); //memberList.CompleteWord(context.InitializationTextRange.StartOffset, context.InitializationTextRange.Length); } else { memberList.Show(toEditor.Caret.Offset, context.InitializationTextRange.Length); //memberList.Show(context.InitializationTextRange.StartOffset, context.InitializationTextRange.Length); } return(true); } else if (memberList.Visible) { memberList.Abort(); } return(false); }