Using the Desktop Client in your module - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

To access the Desktop Client you must pass the call GetClientForm in the event aggregator to ensure the client is correctly initialized to receive calls.

This example code shows a query form searching for users and displaying the output in the message bar service.

  SPFSession.GetClientForm(Me.EventAggregator)

  Dim lcolObjects As IObjectDictionary = _

SPFSession.SessionWrapper.ShowQueryForm("SPFLoginUser", "Test Query form", "ISPFUser")

  If lcolObjects  IsNot Nothing Then

  With lcolObjects.GetStructure.GetEnumerator

  Do While .MoveNext

  Dim lobjStructuredObj As StructuredObject = CType(.Current, StructuredObject)

  Me.MessageBarService.ShowInformation("Found User: " & lobjStructuredObj.IObject.Name)

  Loop

  End With

  End If

If the Desktop Client has already been initialized, it will not be reactivated again. It resides in the memory, which is called faster.