Beispiel #1
0
        public void AddContactToGroup(Contact contact, ContactGroup group)
        {
            if (NSMessageHandler.MSNTicket == MSNTicket.Empty || AddressBook == null)
            {
                OnServiceOperationFailed(this, new ServiceOperationFailedEventArgs("ABGroupContactAdd", new MSNPSharpException("You don't have access right on this action anymore.")));
                return;
            }

            if (contact.Guid == Guid.Empty)
                throw new InvalidOperationException("This is not a valid Messenger contact.");

            ABGroupContactAddAsync(contact, group,
                delegate(object service, ABGroupContactAddCompletedEventArgs e)
                {
                    if (e.Error == null)
                    {
                        contact.AddContactToGroup(group);
                    }
                });
        }