Microsoft.Protocols.TestSuites.MS_ASEMAIL.S01_Email.AddFlagAndCategories C# (CSharp) Method

AddFlagAndCategories() private method

Add flag and categories for an email item
private AddFlagAndCategories ( string collectionId, string syncKey, string serverId ) : SyncStore
collectionId string The collectionId of the folder which contains the specified item.
syncKey string The synchronization key to get the new added email item.
serverId string The server id of the new added email item.
return Microsoft.Protocols.TestSuites.Common.DataStructures.SyncStore
        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);
        }