Programming guidelines for Visual Basic .NET |
The .NET interop library is a wrapped version of the Visual Basic interfaces that has been optimized for .NET and, therefore, the interface details for Visual Basic .NET are very similar to Visual Basic 6. For example, instead of using the Visual Basic 6 objects named AM*, use the equivalent objects named BC*. For example, instead of the AMDocumentRepository object, use BCRepository.
Following are some recommendations for working with Meridian Enterprise API objects and the code that manipulates them.
Dim Managers = ExtensionHost.ScriptObjects.Vault.GetUsers(BlueCieloECM.InnoCielo.Meridian.Scripting.SUserColumnFlags.AS_UCOL_NAME, "Managers") Dim ManagerNames = New ArrayList(Managers).ToArray(GetType(String)) ' Supported by .NET Framework: 1.1 and higher Dim ManagerNames = Managers.Cast(Of String)() ' Supported by .NET Framework: 3.5 and higher Dim ManagerNames = Managers.OfType(Of String)() ' Supported by .NET Framework: 3.5 and higher
You could pass such a collection to the ExecuteTransition method as in the following example.
doc.Workflow.ExecuteTransition(Transition, Comment, UserNames, ManagerNames)
For example:
Using tv As BCReadOnlyCollection(Of BCDocument) = doc.IncomingDocuments For Each d As BCDocument In tv ' The Using statement DOES NOT release the object on server. Using d Dim S As String = d.DisplayName End Using Next End Using
Using tv As BCReadOnlyCollection(Of BCDocument) = doc.IncomingDocuments For i As Integer = 0 To tv.Count - 1 ' The Using statement DOES NOT release the object on server. Using d As BCDocument = tv.Item(i) Dim S As String = d.DisplayName End Using Next i End Using
Using tv As BCReadOnlyCollection(Of BCDocument) = doc.IncomingDocuments For i As Integer= 0 To tv.Count – 1 Dim id As String = tv.GetRowAMID(i) ' The Using statement DOES release the object on server. Using d As BCDocument = repository.GetFSObject(id) S = d.DisplayName End Using Next i End Using