예제 #1
0
 /// <remarks/>
 public void ABGroupUpdateAsync(ABGroupUpdateRequestType ABGroupUpdate1, object userState) {
     if ((this.ABGroupUpdateOperationCompleted == null)) {
         this.ABGroupUpdateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnABGroupUpdateOperationCompleted);
     }
     this.InvokeAsync("ABGroupUpdate", new object[] {
                 ABGroupUpdate1}, this.ABGroupUpdateOperationCompleted, userState);
 }
예제 #2
0
        private void ABGroupUpdateAsync(ContactGroup group, string newGroupName, ABGroupUpdateCompletedEventHandler callback)
        {
            if (NSMessageHandler.MSNTicket == MSNTicket.Empty || AddressBook == null)
            {
                OnServiceOperationFailed(this, new ServiceOperationFailedEventArgs("ABGroupUpdate", new MSNPSharpException("You don't have access right on this action anymore.")));
                return;
            }

            ABGroupUpdateRequestType request = new ABGroupUpdateRequestType();
            request.abId = WebServiceConstants.MessengerIndividualAddressBookId;
            request.groups = new GroupType[1] { new GroupType() };
            request.groups[0].groupId = group.Guid;
            request.groups[0].propertiesChanged = PropertyString.GroupName; //"GroupName";
            request.groups[0].groupInfo = new groupInfoType();
            request.groups[0].groupInfo.name = newGroupName;

            MsnServiceState ABGroupUpdateObject = new MsnServiceState(PartnerScenario.GroupSave, "ABGroupUpdate", true);
            ABServiceBinding abService = (ABServiceBinding)CreateService(MsnServiceType.AB, ABGroupUpdateObject);
            abService.ABGroupUpdateCompleted += delegate(object service, ABGroupUpdateCompletedEventArgs 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, ABGroupUpdateObject, request));
        }
예제 #3
0
 /// <remarks/>
 public void ABGroupUpdateAsync(ABGroupUpdateRequestType ABGroupUpdate1) {
     this.ABGroupUpdateAsync(ABGroupUpdate1, null);
 }