Пример #1
0
 /// <remarks/>
 public void ABGroupContactAddAsync(ABGroupContactAddRequestType ABGroupContactAdd1, object userState) {
     if ((this.ABGroupContactAddOperationCompleted == null)) {
         this.ABGroupContactAddOperationCompleted = new System.Threading.SendOrPostCallback(this.OnABGroupContactAddOperationCompleted);
     }
     this.InvokeAsync("ABGroupContactAdd", new object[] {
                 ABGroupContactAdd1}, this.ABGroupContactAddOperationCompleted, userState);
 }
Пример #2
0
        private void ABGroupContactAddAsync(Contact contact, ContactGroup group, ABGroupContactAddCompletedEventHandler callback)
        {
            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;
            }

            ABGroupContactAddRequestType request = new ABGroupContactAddRequestType();
            request.abId = WebServiceConstants.MessengerIndividualAddressBookId;
            request.groupFilter = new groupFilterType();
            request.groupFilter.groupIds = new string[] { group.Guid };
            request.contacts = new ContactType[] { new ContactType() };
            request.contacts[0].contactId = contact.Guid.ToString();

            MsnServiceState ABGroupContactAddObject = new MsnServiceState(PartnerScenario.GroupSave, "ABGroupContactAdd", true);
            ABServiceBinding abService = (ABServiceBinding)CreateService(MsnServiceType.AB, ABGroupContactAddObject);
            abService.ABGroupContactAddCompleted += delegate(object service, ABGroupContactAddCompletedEventArgs e)
            {
                OnAfterCompleted(new ServiceOperationEventArgs(abService, MsnServiceType.AB, e));

                if (e.Cancelled || NSMessageHandler.MSNTicket == MSNTicket.Empty)
                    return;

                if (callback != null)
                {
                    callback(service, e);
                }
            };

            RunAsyncMethod(new BeforeRunAsyncMethodEventArgs(abService, MsnServiceType.AB, ABGroupContactAddObject, request));
        }
Пример #3
0
 /// <remarks/>
 public void ABGroupContactAddAsync(ABGroupContactAddRequestType ABGroupContactAdd1) {
     this.ABGroupContactAddAsync(ABGroupContactAdd1, null);
 }