Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ActivityTemplate Class

Defines the formatting of an ActivityEvent object within a specific locale.


Namespace:  Microsoft.Office.Server.ActivityFeed
Assembly:  Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)

[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class ActivityTemplate

This object is stored in an ActivityTemplatesCollection in ActivityType. Create a new ActivityTemplate by using the Create method in that collection. The IsMultivalued property defines whether the template is set to display links for multiple events instead of one. The TitleFormatLocStringResourceFile property of this class should contain the name of the resource file that contains the localized strings that you are using to display events in an activity feed. The TitleFormatLocStringName property should refer to the name of the entry in your resource file whose value defines the display for a particular event. Values stored in the resource file can insert string properties in the ActivityEvent by placing the name of the property in braces, as in the following example.

<value xml:space="preserve">{Publisher} has created a new community: {Link}</value>

For instructions on how to create a resource file, see Creating Resource Files. For a code sample that uses a resource file, see Microsoft SharePoint Server 2010: Activity Feeds Console Application

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft