private SyncStore AddFlagAndCategories(string collectionId, string syncKey, string serverId)
{
Request.Flag flag = new Request.Flag
{
Status = "2",
FlagType = "for Follow Up",
CompleteTime = DateTime.Now,
CompleteTimeSpecified = true,
DateCompleted = DateTime.Now,
DateCompletedSpecified = true
};
Collection<string> categories = new Collection<string>();
if (!Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site).Equals("12.1"))
{
string category = Common.GenerateResourceName(Site, "Category");
categories.Add(category);
}
else
{
categories = null;
}
// Add category and flag to the email item and set Read property to true
this.UpdateEmail(collectionId, syncKey, true, serverId, flag, categories);
// Get the result of adding flag and category
return this.SyncChanges(syncKey, collectionId, null);
}