コード例 #1
0
        private object LoadCertificates()
        {
            object obj;

            Application.DoEvents();
            NSDictionary nSDictionary = AppleService.login(this.cmbAppleId.Text, this.txtPassword.Text);

            if (nSDictionary.ContainsKey("myacinfo"))
            {
                string str = nSDictionary.ObjectForKey("myacinfo").ToString();
                Application.DoEvents();
                nSDictionary = AppleService.listTeam(str);
                this.teamId  = "";
                if (nSDictionary.ContainsKey("teams"))
                {
                    NSArray nSArray = (NSArray)nSDictionary.ObjectForKey("teams");
                    if (nSArray.get_Count() > 0)
                    {
                        NSDictionary nSDictionary1 = (NSDictionary)nSArray.ElementAt <NSObject>(0);
                        if (nSDictionary1.ContainsKey("teamId"))
                        {
                            this.teamId = nSDictionary1.ObjectForKey("teamId").ToString();
                        }
                    }
                }
                if (Operators.CompareString(this.teamId, "", false) != 0)
                {
                    Application.DoEvents();
                    nSDictionary = AppleService.allDevelopmentCert(this.teamId);
                    this.lstCydia.Clear();
                    this.lstCydia.Clear();
                    this.lstCydia.View = View.Details;
                    this.lstCydia.Columns.Add("Name", 500);
                    this.lstCydia.Columns.Add("Serial");
                    if (nSDictionary.ContainsKey("certificates"))
                    {
                        NSArray nSArray1 = (NSArray)nSDictionary.ObjectForKey("certificates");
                        int     count    = checked (nSArray1.get_Count() - 1);
                        for (int i = 0; i <= count; i = checked (i + 1))
                        {
                            NSDictionary nSDictionary2 = (NSDictionary)nSArray1.ElementAt <NSObject>(i);
                            if (nSDictionary2.ContainsKey("name") & nSDictionary2.ContainsKey("serialNumber"))
                            {
                                ListViewItem listViewItem = new ListViewItem();
                                if (!nSDictionary2.ContainsKey("machineName"))
                                {
                                    listViewItem.Text = nSDictionary2.ObjectForKey("name").ToString();
                                }
                                else
                                {
                                    listViewItem.Text = string.Concat(nSDictionary2.ObjectForKey("name").ToString(), " - ", nSDictionary2.ObjectForKey("machineName").ToString());
                                }
                                listViewItem.SubItems.Add(nSDictionary2.ObjectForKey("serialNumber").ToString());
                                this.lstCydia.Items.Add(listViewItem);
                            }
                        }
                        if (this.lstCydia.Items.Count == 0)
                        {
                            obj = "No Certificates";
                            return(obj);
                        }
                    }
                    obj = "";
                }
                else
                {
                    obj = "Not have teamId";
                }
            }
            else
            {
                obj = "Cannot login itune...";
            }
            return(obj);
        }
コード例 #2
0
        private object LoadApps()
        {
            object obj;

            Application.DoEvents();
            NSDictionary nSDictionary = AppleService.login(this.cmbAppleId.Text, this.txtPassword.Text);

            if (nSDictionary.ContainsKey("myacinfo"))
            {
                string str = nSDictionary.ObjectForKey("myacinfo").ToString();
                Application.DoEvents();
                nSDictionary = AppleService.listTeam(str);
                this.teamId  = "";
                if (nSDictionary.ContainsKey("teams"))
                {
                    NSArray nSArray = (NSArray)nSDictionary.ObjectForKey("teams");
                    if (nSArray.get_Count() > 0)
                    {
                        NSDictionary nSDictionary1 = (NSDictionary)nSArray.ElementAt <NSObject>(0);
                        if (nSDictionary1.ContainsKey("teamId"))
                        {
                            this.teamId = nSDictionary1.ObjectForKey("teamId").ToString();
                        }
                    }
                }
                if (Operators.CompareString(this.teamId, "", false) != 0)
                {
                    this.lstCydia.Clear();
                    this.lstCydia.Clear();
                    this.lstCydia.View = View.Details;
                    this.lstCydia.Columns.Add("Name", 234);
                    this.lstCydia.Columns.Add("Id");
                    Application.DoEvents();
                    nSDictionary = AppleService.appIds(this.teamId);
                    string str1 = "";
                    if (nSDictionary.ContainsKey("appIds"))
                    {
                        NSArray nSArray1 = (NSArray)nSDictionary.ObjectForKey("appIds");
                        int     count    = checked (nSArray1.get_Count() - 1);
                        for (int i = 0; i <= count; i = checked (i + 1))
                        {
                            NSDictionary nSDictionary2 = (NSDictionary)nSArray1.ElementAt <NSObject>(i);
                            if (nSDictionary2.ContainsKey("appIdId") & nSDictionary2.ContainsKey("name"))
                            {
                                str1 = nSDictionary2.ObjectForKey("appIdId").ToString();
                                ListViewItem listViewItem = new ListViewItem()
                                {
                                    Text = nSDictionary2.ObjectForKey("name").ToString()
                                };
                                listViewItem.SubItems.Add(nSDictionary2.ObjectForKey("appIdId").ToString());
                                this.lstCydia.Items.Add(listViewItem);
                            }
                        }
                        if (this.lstCydia.Items.Count == 0)
                        {
                            obj = "No AppId";
                            return(obj);
                        }
                    }
                    obj = "";
                }
                else
                {
                    obj = "Not have teamId";
                }
            }
            else
            {
                obj = "Cannot login itune...";
            }
            return(obj);
        }