Share via


SocialFeed.Threads property

Gets the threads that make up the feed.

Namespace:  Microsoft.SharePoint.Client.Social
Assembly:  Microsoft.SharePoint.Client.UserProfiles (in Microsoft.SharePoint.Client.UserProfiles.dll)

Syntax

'Declaration
Public ReadOnly Property Threads As SocialThread()
    Get
'Usage
Dim instance As SocialFeed
Dim value As SocialThread()

value = instance.Threads
public SocialThread[] Threads { get; }

Property value

Type: []

Examples

The following code iterates through the threads in the feed. It gets the thread identifier and the text of the root post and checks whether each thread has the CanReply attribute.

See How to: Learn to read and write to the social feed by using the .NET client object model in SharePoint 2013 and How to: Create and delete posts and retrieve the social feed by using the .NET client object model in SharePoint 2013 for complete code examples that work with feeds.

for (int i = 0; i < feed.Value.Threads.Length; i++)
{
    SocialThread thread = feed.Value.Threads[i]; 
    string threadId = thread.Id;
    string postText = thread.RootPost.Text;
    if (thread.Attributes.HasFlag(SocialThreadAttributes.CanReply))
    {
        Console.WriteLine(("\t" + threadId + " " + postText);
    }
}

See also

Reference

SocialFeed class

SocialFeed members

Microsoft.SharePoint.Client.Social namespace