Esempio n. 1
0
 /// <remarks/>
 public void DeleteContactAsync(DeleteContactRequestType DeleteContact1, object userState) {
     if ((this.DeleteContactOperationCompleted == null)) {
         this.DeleteContactOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteContactOperationCompleted);
     }
     this.InvokeAsync("DeleteContact", new object[] {
                 DeleteContact1}, this.DeleteContactOperationCompleted, userState);
 }
Esempio n. 2
0
        private void DeleteContactAsync(Contact contact,
            DeleteContactCompletedEventHandler callback)
        {
            if (NSMessageHandler.MSNTicket == MSNTicket.Empty || AddressBook == null)
            {
                OnServiceOperationFailed(this, new ServiceOperationFailedEventArgs("DeleteContact", new MSNPSharpException("You don't have access right on this action anymore.")));
                return;
            }

            DeleteContactRequestType request = new DeleteContactRequestType();
            request.contactId = contact.Guid.ToString("D").ToLowerInvariant();

            MsnServiceState deleteContactObject = new MsnServiceState(PartnerScenario.Timer, "DeleteContact", true);
            ABServiceBinding abService = (ABServiceBinding)CreateService(MsnServiceType.AB, deleteContactObject);
            abService.DeleteContactCompleted += delegate(object service, DeleteContactCompletedEventArgs 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, deleteContactObject, request));
        }
Esempio n. 3
0
 /// <remarks/>
 public void DeleteContactAsync(DeleteContactRequestType DeleteContact1) {
     this.DeleteContactAsync(DeleteContact1, null);
 }