Exemple #1
0
 /// <remarks/>
 public void GetContactsRecentActivityAsync(GetContactsRecentActivityRequestType GetContactsRecentActivity1) {
     this.GetContactsRecentActivityAsync(GetContactsRecentActivity1, null);
 }
Exemple #2
0
 /// <remarks/>
 public void GetContactsRecentActivityAsync(GetContactsRecentActivityRequestType GetContactsRecentActivity1, object userState) {
     if ((this.GetContactsRecentActivityOperationCompleted == null)) {
         this.GetContactsRecentActivityOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetContactsRecentActivityOperationCompleted);
     }
     this.InvokeAsync("GetContactsRecentActivity", new object[] {
                 GetContactsRecentActivity1}, this.GetContactsRecentActivityOperationCompleted, userState);
 }
Exemple #3
0
        /// <summary>
        /// Get the recent activities of your contacts.
        /// </summary>
        /// <param name="count">Max activity count, must be larger than zero and less than 200.</param>
        public void GetWhatsUp(int count)
        {
            if (count > 200)
            {
                count = 200;
            }
            else if (count < 0)
            {
                count = 50;
            }

            if (NSMessageHandler.MSNTicket != MSNTicket.Empty)
            {
                MsnServiceState getContactsRecentActivityObject = new MsnServiceState(PartnerScenario.None, "GetContactsRecentActivity", true);
                WhatsUpServiceBinding wuService = (WhatsUpServiceBinding)CreateService(MsnServiceType.WhatsUp, getContactsRecentActivityObject);
                wuService.GetContactsRecentActivityCompleted += delegate(object sender, GetContactsRecentActivityCompletedEventArgs e)
                {
                    OnAfterCompleted(new ServiceOperationEventArgs(wuService, MsnServiceType.WhatsUp, e));

                    if (NSMessageHandler.MSNTicket == MSNTicket.Empty)
                        return;

                    if (e.Cancelled)
                        return;

                    if (e.Error != null)
                    {
                        OnGetWhatsUpCompleted(this, new GetWhatsUpCompletedEventArgs(e.Error, null));
                        Trace.WriteLineIf(Settings.TraceSwitch.TraceError, e.Error.Message, GetType().Name);
                        return;
                    }

                    if (e.Result.GetContactsRecentActivityResult != null)
                    {
                        feedUrl = e.Result.GetContactsRecentActivityResult.FeedUrl;
                        OnGetWhatsUpCompleted(this, new GetWhatsUpCompletedEventArgs(null, e.Result.GetContactsRecentActivityResult));
                    }
                    else
                    {
                        OnGetWhatsUpCompleted(this, new GetWhatsUpCompletedEventArgs(null, null));
                    }
                };

                GetContactsRecentActivityRequestType request = new GetContactsRecentActivityRequestType();
                request.entityHandle = new entityHandle();
                request.entityHandle.Cid = Convert.ToInt64(NSMessageHandler.Owner.CID);
                request.locales = new string[] { System.Globalization.CultureInfo.CurrentCulture.Name };
                request.count = count;

                RunAsyncMethod(new BeforeRunAsyncMethodEventArgs(wuService, MsnServiceType.WhatsUp, getContactsRecentActivityObject, request));
            }
        }