Exemplo n.º 1
0
        public PListRoot GetAppList()
        {
            lock (sync)
            {
                var send_plist = CreateBrowsePlist();

                PropertyListService.Send(sd, send_plist);

                PListArray array = new PListArray();

                bool browsing;
                do
                {
                    browsing = false;

                    var dic = PropertyListService.Receive(sd) as PListDict;

                    var status = (dic["Status"] as PListString).Value;

                    if (status == "BrowsingApplications")
                    {
                        browsing = true;

                        var amount       = dic["CurrentAmount"] as PListInteger;
                        var current_list = dic["CurrentList"] as PListArray;

                        array.AddRange(current_list);
                    }
                    else
                    {
                        //status == "Complete"
                        Debug.WriteLine("Browse 完成");
                    }
                } while (browsing);

                return(new PListRoot()
                {
                    Root = array
                });
            }
        }