protected ContactItemType CreateFileAsMappingTypeContact(FileAsMappingType fileAsMappingType)
{
// Create a contact item type.
ContactItemType item = new ContactItemType()
{
// Set the relevant properties on the contact.
FileAsMapping = fileAsMappingType,
FileAsMappingSpecified = true,
// Set the information of complete name for the contact.
DisplayName = Common.GenerateResourceName(
this.Site,
"DisplayName"),
GivenName = Common.GenerateResourceName(
this.Site,
"GivenName"),
MiddleName = Common.GenerateResourceName(
this.Site,
"MiddleName"),
Surname = Common.GenerateResourceName(
this.Site,
"SurName"),
Generation = Common.GenerateResourceName(
this.Site,
"SR."),
// Set the information of company for the contact.
Companies = new string[]
{
Common.GenerateResourceName(
this.Site,
"Company")
},
CompanyName = Common.GenerateResourceName(
this.Site,
"Company"),
};
if (fileAsMappingType == FileAsMappingType.None)
{
item.FileAs = Common.GenerateResourceName(
this.Site, "FirstContact");
}
return item;
}