当前位置: 首页>>代码示例>>C#>>正文


C# Contact.Clone方法代码示例

本文整理汇总了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();
        }
开发者ID:treejames,项目名称:MESDemo,代码行数:25,代码来源:frmEditContact.cs

示例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;
            }
        }
开发者ID:sarandogou,项目名称:boghe,代码行数:50,代码来源:ContactService.cs


注:本文中的Contact.Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。