Which code segment should you use?

You create a custom web part that displays the audience that the user belongs to.

Which code segment should you use?

You create a custom web part that displays the audience that the user belongs to.

Which code segment should you use?

A.
Dim aManager As New AudienceManager()
Dim userAudienceIDs As ArrayList = aManager.GetAudienceIDs(false) Dim userAudName As ArrayList = aManager.GetAudienceNames(aManager.audienceOperatorList)

B.
Dim aManager As New AudienceManager()
Dim userAudienceIDs As ArrayList = aManager.GetAudienceIDs(true) Dim userAudName As ArrayList = aManager.GetAudienceNames(userAudienceDs)

C.
Dim userAudNames As New ArrayList()
Dim user As SPUser = SPContext.Current.Web.CurrentUser
For Each group as SPGroupEndUser.Groups
If group.XML.Contains(“Type=Audience”) Then
userAudNames.Add(group.Name)
End If
Next

D.
Dim userAudNames As New ArrayList()
Dim user As SPUser = SPContext.Current.Web.CurrentUser
For Each group as SPGroupEndUser.Groups
If group.ContainsCurrentUser And Also group.XML.Contains(“Type=Audience”) Then userAudNames.Add(group.Name)
End If
Next



Leave a Reply 0

Your email address will not be published. Required fields are marked *