Posted 14 years ago by Janet Dorenkott
Avatar
I have an extension to my String class to check for Null values in VB.NET called .IsNull which returns a Boolean.

Say my string variable is STR

When I type STR. and the standard Methods/Properties for VB.NET Strings comes up,
I need it to also show my IsNull property in that list.

How can I add an additional member to that list in code?

Thanks

Comments (4)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Janet,

Check out the "SyntaxEditor .NET Languages Add-on Guide / Member List Pre-Filtering" documentation topic. That is the mechanism you can use to add/remove items before the member list gets displayed.


Actipro Software Support

Posted 14 years ago by Janet Dorenkott
Avatar
Cool, thanks. It might be nice to document what the ImageIndexes are for the IntelliPromptMemberListItem constructor. I can't find where it tells me what image index equates to which type icon
Posted 14 years ago by Janet Dorenkott
Avatar
Here's the code in case anyone else is interested down the road...
(watch for line wrapping...)
-------------------------------------------------

AddHandler language.SyntaxEditorIntelliPromptMemberListPreFilter, AddressOf AddIntellisenseMethods

------------

Private Sub AddIntellisenseMethods(ByVal sender As Object, ByVal e As ActiproSoftware.SyntaxEditor.IntelliPromptMemberListPreFilterEventArgs)

Dim c As ActiproSoftware.SyntaxEditor.Addons.VB.VBContext
Dim i As ActiproSoftware.SyntaxEditor.IntelliPromptMemberListItem
Dim StartingObject As String = ""

Try
If Not (e Is Nothing) Then
If Not (e.Context Is Nothing) Then
If TypeOf (e.Context) Is ActiproSoftware.SyntaxEditor.Addons.VB.VBContext Then

c = CType(e.Context, ActiproSoftware.SyntaxEditor.Addons.VB.VBContext)

If Not (c.Items Is Nothing) Then
If c.Items.GetUpperBound(0) > 0 Then
' Look for the beginning object I care about, for instance, ObjX.ItemId
' Where ObjX is a valid Alias, I want to add my IsNull method...
' You may want to look at ItemId whereas that would be c.Items(1) below.
StartingObject = c.Items(0).Text

If Not (StartingObject Is Nothing) Then
If Not (m_Aliases.Item(StartingObject) Is Nothing) Then
i = New ActiproSoftware.SyntaxEditor.IntelliPromptMemberListItem("IsNull", -1, "Boolean. If the original underlying data was Null or Nothing")

If Not (e.Items Is Nothing) Then
If e.Items("IsNull") Is Nothing Then
e.Items.Add("IsNull", i)
End If
End If
End If
End If
End If
End If
End If
End If
End If
Catch ex As Exception
' Couldn't add it, but it's just intellisense
' so don't blow up the app over it...
End Try

End Sub
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Janet,

Check out the "Using the Reflection ImageList" section in the "Member List" documentation topic. That talks about it.


Actipro Software Support

The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.