Exemplo n.º 1
0
        public GetManyResponse GetMany([System.Xml.Serialization.XmlElementAttribute("GetMany", Namespace = "http://profile.live.com/")] GetManyRequestType GetMany1)
        {
            object[] results = this.Invoke("GetMany", new object[] {
                GetMany1
            });

            return((GetManyResponse)(results[0]));
        }
Exemplo n.º 2
0
 /// <remarks/>
 public void GetManyAsync(GetManyRequestType GetMany1, object userState)
 {
     if ((this.GetManyOperationCompleted == null))
     {
         this.GetManyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetManyOperationCompleted);
     }
     this.InvokeAsync("GetMany", new object[] {
         GetMany1
     }, this.GetManyOperationCompleted, userState);
 }
Exemplo n.º 3
0
 /// <remarks/>
 public void GetManyAsync(GetManyRequestType GetMany1)
 {
     this.GetManyAsync(GetMany1, null);
 }
Exemplo n.º 4
0
 /// <remarks/>
 public void GetManyAsync(GetManyRequestType GetMany1, object userState) {
     if ((this.GetManyOperationCompleted == null)) {
         this.GetManyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetManyOperationCompleted);
     }
     this.InvokeAsync("GetMany", new object[] {
                 GetMany1}, this.GetManyOperationCompleted, userState);
 }
Exemplo n.º 5
0
 /// <remarks/>
 public void GetManyAsync(GetManyRequestType GetMany1) {
     this.GetManyAsync(GetMany1, null);
 }
Exemplo n.º 6
0
        public void GetMany(long[] cids, EventHandler<EventArgs> onSuccess, EventHandler<ExceptionEventArgs> onError)
        {
            if (NSMessageHandler.MSNTicket != MSNTicket.Empty)
            {
                MsnServiceState getManyObject = new MsnServiceState(PartnerScenario.Initial, "GetMany", true);
                DirectoryService dirService = (DirectoryService)CreateService(MsnServiceType.Directory, getManyObject);
                dirService.GetManyCompleted += delegate(object sender, GetManyCompletedEventArgs e)
                {
                    OnAfterCompleted(new ServiceOperationEventArgs(dirService, MsnServiceType.Directory, e));

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

                    if (e.Cancelled)
                        return;

                    if (e.Error != null)
                    {
                        OnServiceOperationFailed(this, new ServiceOperationFailedEventArgs("Get", e.Error));
                        if (onError != null)
                            onError(sender, new ExceptionEventArgs(e.Error));
                        return;
                    }

                    if (e.Result.GetManyResult != null)
                    {
                        GetManyResultType r = e.Result.GetManyResult;
                        for (int i = 0; i < r.Ids.Length; i++)
                        {
                            IdType idType = r.Ids[i];
                            if (idType != null && idType.Ns1 == "Cid")
                            {
                                long cid;
                                if (long.TryParse(idType.V1.ToString(), out cid) && cid != 0)
                                {
                                    FindContactByCidAndFireCoreProfileUpdated(cid, r.Views[i]);
                                }
                            }
                        }
                    }

                    if (onSuccess != null)
                    {
                        onSuccess(sender, e);
                    }
                };

                List<IdType> ids = new List<IdType>(cids.Length);

                foreach (long cid in cids)
                {
                    IdType id = new IdType();
                    id.Ns1 = "Cid";
                    id.V1 = cid;

                    id.Ns2 = "Unspecified";
                    id.V2 = null;

                    ids.Add(id);
                }

                GetManyRequestType request = new GetManyRequestType();
                request.request = new GetManyRequestTypeRequest();
                request.request.ViewName = "WLX.DC.CoreProfile";
                request.request.Ids = ids.ToArray();

                RunAsyncMethod(new BeforeRunAsyncMethodEventArgs(dirService, MsnServiceType.Directory, getManyObject, request));
            }
        }