本文整理汇总了C#中Contact.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Contact.Clone方法的具体用法?C# Contact.Clone怎么用?C# Contact.Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contact
的用法示例。
在下文中一共展示了Contact.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: frmEditContact
public frmEditContact(Contact contact, IDXMenuManager menuManager)
{
InitializeComponent();
this.contact = contact;
this.bindingContact = contact.Clone();
InitEditors();
InitMenuManager(menuManager);
pePhoto.Image = bindingContact.Photo;
teFirstName.DataBindings.Add("Text", bindingContact.FullName, "FirstName");
teLastName.DataBindings.Add("Text", bindingContact.FullName, "LastName");
teMiddleName.DataBindings.Add("Text", bindingContact.FullName, "MiddleName");
icbTitle.DataBindings.Add("EditValue", bindingContact.FullName, "Title");
meLine.DataBindings.Add("Text", bindingContact.Address, "AddressLine");
cbeState.DataBindings.Add("Text", bindingContact.Address, "State");
cbeCity.DataBindings.Add("Text", bindingContact.Address, "City");
teZip.DataBindings.Add("Text", bindingContact.Address, "Zip");
teEmail.DataBindings.Add("Text", bindingContact, "Email");
tePhone.DataBindings.Add("Text", bindingContact, "Phone");
deBirthDate.DataBindings.Add("DateTime", bindingContact, "BindingBirthDate");
icbGender.DataBindings.Add("EditValue", bindingContact, "Gender");
richEditControl1.DataBindings.Add("HtmlText", bindingContact, "Note");
UpdateCaption();
InitValidationProvider();
}
示例2: ContactAuthorize
public bool ContactAuthorize(Contact contact, BogheXdm.Authorization authorization)
{
#if !WINRT
if (this.sipService.IsXcapEnabled)
{
lock (this.groups)
{
Group group = this.groups.FirstOrDefault(x => x.Authorization == authorization);
if (group == null)
{
LOG.Error("Failed to find a group matching this authorization");
}
else if (!String.Equals(contact.GroupName, group.Name))
{
Contact clone = contact.Clone() as Contact; // Clone() to avoid triggering OnPropertyChanged() before the end of the event
clone.GroupName = group.Name; // update group
String prevGroupName = contact.GroupName;
if (this.ContactUpdate(clone, prevGroupName))
{
// Trigger OnCollectionChanged()
lock (this.contacts)
{
int index = this.contacts.IndexOf(contact);
if (index != -1)
{
this.contacts[index] = clone;
}
else
{
this.contacts.Add(clone);
}
}
this.ContactSignal(contact, ContactEventTypes.CONTACT_UPDATED);
return true;
}
else
{
return false;
}
}
}
return true;
}
else
#endif
{
LOG.Error("Must enable XCAP storage to change authorizations");
return false;
}
}