AudienceManager.IsCurrentUserInAudienceOf method (String, Boolean)
This method will check whether current user's Audience membership belong to any audience as defined within audienceTextRepresentation. If does, return true, else return false. If there is any exception occured, this function will return false and log the exception, raise ShipAssert()
Namespace: Microsoft.Office.Server.Audience
Assembly: Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)
Syntax
'Declaration
Public Shared Function IsCurrentUserInAudienceOf ( _
audienceTextRepresentation As String, _
showUntargetedAudience As Boolean _
) As Boolean
'Usage
Dim audienceTextRepresentation As String
Dim showUntargetedAudience As Boolean
Dim returnValue As Boolean
returnValue = AudienceManager.IsCurrentUserInAudienceOf(audienceTextRepresentation, _
showUntargetedAudience)
public static bool IsCurrentUserInAudienceOf(
string audienceTextRepresentation,
bool showUntargetedAudience
)
Parameters
audienceTextRepresentation
Type: System.String..
showUntargetedAudience
Type: System.Boolean..
Return value
Type: System.Boolean
true or false to mean whether current user is in audience or not