Exemplo n.º 1
0
 public AsteroidTexture(GraphicsDevice graphicsDevice, string file, Friend friend)
 {
     TextureFile = file;
     Friend = friend;
     IsFriend = friend != null;
     GraphicsDevice = graphicsDevice;
     //initialize(graphicsDevice);
 }
Exemplo n.º 2
0
 public FriendElement(Friend friend)
     : base(friend.DisplayName,!friend.Exclude)
 {
     Friend = friend;
     this.ValueChanged  += delegate {
         Friend.Exclude = !this.Value;
         Database.Main.Update(Friend);
     };
 }
Exemplo n.º 3
0
        //static List<string> images = new List<string> ();
        private static List<Friend> parseFriends(JsonValue root)
        {
            progress.TitleText = "Downloading Friends";
            //images = new List<string> ();
            var data = root["data"];
            friendCount = data.Count;
            friendCompleted = 0;
            progress.Progress = 0;
            foreach (JsonObject jentry in data) {
                var juser = jentry["name"];
                string jid = jentry["id"].ToString ();
                jid = jid.Replace ("\"", "");
                var imgURl = "http://graph.facebook.com/" + jid.ToString () + "/picture?type=large";

                lock(Database.Main)
                {
                    Friend friend = Database.Main.Table<Friend>().Where(x=> x.ID == jid).FirstOrDefault();
                    if(friend == null)
                    {
                        friend = new Friend(){ID = jid,Img = imgURl,DisplayName = juser};
                        Database.Main.Insert(friend);
                    }
                    friend.Img = imgURl;
                    friend.DisplayName = juser;

                    if(ShouldPost && friend.LastFacebookPost < DateTime.Now.AddDays(-1))
                    {
                        PostOnFriendsWall(jid);
                        friend.LastFacebookPost = DateTime.Now;
                        Database.Main.Update(friend);
                    }

                }
                /*
                if (images.Count >= 30) {
                    lock (locker)
                        parseFaces (faceRest.faces_detect (images, null, null, null));
                    images = new List<string> ();
                }

                images.Add (imgURl);
                */
                //faceRest.faces_detect(new List<string>{imgURl},null,null,null);
                var img = ImageStore.RequestProfilePicture (jid.ToString (), imgURl, true, Notifier);
                if (img != null) {
                    UpdatedImage (jid.ToString ());
                }
                //Console.WriteLine(message);
                //Console.WriteLine (juser.ToString ());
            }

            return new List<Friend> ();
        }