public ProfilePage()
        {
            InitializeComponent();

            QContactDB qcdb   = new QContactDB();
            var        pItems = new List <pItem>();

            string   fbId  = Helpers.Settings.UserId;
            string   keyId = fbId + "," + fbId;
            QContact qc    = qcdb.GetQContact(keyId);

            if (qc == null)
            {
                qc = new QContact();
            }
            var type       = qc.GetType();
            var properties = type.GetRuntimeProperties();

            foreach (PropertyInfo prop in properties)
            {
                if (!prop.Name.Equals("myIdfriendId"))
                {
                    pItem p = new pItem();
                    // Add space
                    if (!prop.Name.Equals("LinkedIn"))
                    {
                        p.pName = Regex.Replace(prop.Name, "([a-z])_?([A-Z])", "$1 $2");
                    }
                    else
                    {
                        p.pName = prop.Name;
                    }

                    if (p.pName.Equals("Birthday"))
                    {
                        if (prop.GetValue(qc, null) != null)
                        {
                            p.pValue = ((DateTime)prop.GetValue(qc, null)).ToLocalTime().ToString("MM/dd/yyyy");
                        }
                    }
                    else if (p.pName.Equals("LastModified"))
                    {
                        p.pValue = (((DateTime)prop.GetValue(qc, null)).ToString() + " UTC");
                    }
                    else
                    {
                        p.pValue = prop.GetValue(qc, null) != null?prop.GetValue(qc, null).ToString() : "";
                    }
                    pItems.Add(p);
                }
            }
            pListView.ItemsSource = pItems;
            pImage.Source         = ImageSource.FromUri(new Uri("http://graph.facebook.com/" + fbId + "/picture?type=small"));
        }
Beispiel #2
0
    public static Hashtable loadItems()
    {
        Hashtable     i     = new Hashtable();
        List <string> lines = FS.readFile("files/items.csv");

        foreach (string item in lines)
        {
            pItem    nItem    = new pItem();
            char[]   splitter = { ',' };
            string[] data     = item.Split(splitter);

            nItem.itemID     = int.Parse(data[0]);
            nItem.power      = int.Parse(data[1]);
            nItem.count      = int.Parse(data[2]);
            nItem.itemName   = data[3].ToString();
            nItem.durability = float.Parse(data[4]);
            //string objKey = "/items/obj/" + nItem.itemName + ".obj";
            //nItem.obj = (GameObject)Resources.Load (objKey, typeof(GameObject));
            i.Add(nItem.itemName, nItem);
        }
        return(i);
    }
Beispiel #3
0
 Insert(pItem, pos);
Beispiel #4
0
    /* ######### ITEM ######### */

    /**
    ** @PARAM i : pItem #itemStruct
    **/
    public void setItem(pItem i)
    {
        this.item = i;
    }