private void ABGroupDeleteAsync(ContactGroup contactGroup, ABGroupDeleteCompletedEventHandler callback) { if (NSMessageHandler.MSNTicket == MSNTicket.Empty || AddressBook == null) { OnServiceOperationFailed(this, new ServiceOperationFailedEventArgs("ABGroupDelete", new MSNPSharpException("You don't have access right on this action anymore."))); return; } ABGroupDeleteRequestType request = new ABGroupDeleteRequestType(); request.abId = WebServiceConstants.MessengerIndividualAddressBookId; request.groupFilter = new groupFilterType(); request.groupFilter.groupIds = new string[] { contactGroup.Guid }; MsnServiceState ABGroupDeleteObject = new MsnServiceState(PartnerScenario.Timer, "ABGroupDelete", true); ABServiceBinding abService = (ABServiceBinding)CreateService(MsnServiceType.AB, ABGroupDeleteObject); abService.ABGroupDeleteCompleted += delegate(object service, ABGroupDeleteCompletedEventArgs 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, ABGroupDeleteObject, request)); }
private void ABGroupDeleteAsync(ContactGroup contactGroup, ABGroupDeleteCompletedEventHandler callback) { if (NSMessageHandler.MSNTicket == MSNTicket.Empty || AddressBook == null) { OnServiceOperationFailed(this, new ServiceOperationFailedEventArgs("ABGroupDelete", new MSNPSharpException("You don't have access right on this action anymore."))); return; } ABGroupDeleteRequestType request = new ABGroupDeleteRequestType(); request.abId = WebServiceConstants.MessengerIndividualAddressBookId; request.groupFilter = new groupFilterType(); request.groupFilter.groupIds = new string[] { contactGroup.Guid }; MsnServiceState ABGroupDeleteObject = new MsnServiceState(PartnerScenario.Timer, "ABGroupDelete", true); ABServiceBinding abService = (ABServiceBinding)CreateService(MsnServiceType.AB, ABGroupDeleteObject); abService.ABGroupDeleteCompleted += delegate(object service, ABGroupDeleteCompletedEventArgs 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, ABGroupDeleteObject, request)); }