WriteSetOrAppendMembersToXml method
void
WriteSetOrAppendMembersToXml(
- EwsServiceXmlWriter writer,
- List<
GroupMember> members, - bool setMode
Implementation
// /* private */ void WriteDeleteMembersToXml(EwsServiceXmlWriter writer, List<GroupMember> members)
// {
// if (members.length != 0)
// {
// GroupMemberPropertyDefinition memberPropDef = new GroupMemberPropertyDefinition();
//
// for (GroupMember member in members)
// {
// writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.DeleteItemField);
//
// memberPropDef.Key = member.Key;
// memberPropDef.WriteToXml(writer);
//
// writer.WriteEndElement(); // DeleteItemField
// }
// }
// }
/// <summary>
/// Generate XML to Set or Append members.
/// When members are set, the existing PDL member collection is cleared.
/// On append members are added to the PDL existing members collection.
/// </summary>
/// <param name="writer">Xml writer.</param>
/// <param name="members">Members to set or append.</param>
/// <param name="setMode">True - set members, false - append members.</param>
/* private */
void WriteSetOrAppendMembersToXml(
EwsServiceXmlWriter writer, List<GroupMember> members, bool setMode) {
if (members.length != 0) {
writer.WriteStartElement(
XmlNamespace.Types,
setMode
? XmlElementNames.SetItemField
: XmlElementNames.AppendToItemField);
ContactGroupSchema.Members.WriteToXml(writer);
writer.WriteStartElement(
XmlNamespace.Types, XmlElementNames.DistributionList);
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.Members);
for (GroupMember member in members) {
member.WriteToXml(writer, XmlElementNames.Member);
}
writer.WriteEndElement(); // Members
writer.WriteEndElement(); // Group
writer.WriteEndElement(); // setMode ? SetItemField : AppendItemField
}
}