コード例 #1
0
ファイル: Reference.cs プロジェクト: quynh68/msnp-sharp
 /// <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);
 }
コード例 #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));
        }
コード例 #3
0
ファイル: Reference.cs プロジェクト: quynh68/msnp-sharp
 /// <remarks/>
 public void DeleteContactAsync(DeleteContactRequestType DeleteContact1) {
     this.DeleteContactAsync(DeleteContact1, null);
 }