Microsoft.Protocols.TestSuites.Common.Common.LoadChangeElements C# (CSharp) Method

LoadChangeElements() public static method

Load Change elements in Sync response
public static LoadChangeElements ( Response collectionCommands, Collection changeElements ) : void
collectionCommands Response The change operation response
changeElements Collection The collection to be loaded in
return void
        public static void LoadChangeElements(Response.SyncCollectionsCollectionCommands collectionCommands, Collection<DataStructures.Sync> changeElements)
        {
            if (collectionCommands.Change == null)
            {
                return;
            }

            foreach (Response.SyncCollectionsCollectionCommandsChange changeCommand in collectionCommands.Change)
            {
                DataStructures.Sync syncItem = new DataStructures.Sync { ServerId = changeCommand.ServerId };
                if (changeCommand.ApplicationData != null && changeCommand.ApplicationData.ItemsElementName.Length > 0)
                {
                    syncItem.Email = DataStructures.Email.DeserializeFromChangeApplicationData<DataStructures.Email>(changeCommand.ApplicationData);
                    syncItem.Calendar = DataStructures.Calendar.DeserializeFromChangeApplicationData<DataStructures.Calendar>(changeCommand.ApplicationData);
                    syncItem.Note = DataStructures.Note.DeserializeFromChangeApplicationData<DataStructures.Note>(changeCommand.ApplicationData);
                    syncItem.Contact = DataStructures.Contact.DeserializeFromChangeApplicationData<DataStructures.Contact>(changeCommand.ApplicationData);
                    syncItem.Task = DataStructures.Task.DeserializeFromChangeApplicationData<DataStructures.Task>(changeCommand.ApplicationData);
                }

                changeElements.Add(syncItem);
            }
        }
Common