public MonkeyView (Monkey monkey)
		{
			Monkey = monkey;
			image = new UIImageView (UIImage.FromBundle (monkey.Name));
			this.AddSubview (image);
			this.Frame = image.Frame;
		}
Exemplo n.º 2
0
        public void Update(Monkey monkey, RectangleF bounds)
        {
            var transform = CGAffineTransform.MakeIdentity ();
            transform.Rotate (monkey.Rotation);
            transform.Scale (monkey.Scale, monkey.Scale);
            this.Transform = transform;

            var x = bounds.Width * monkey.X;
            var y = bounds.Height * monkey.Y;
            this.Center = new PointF (x, y);
        }
Exemplo n.º 3
0
 public void UpdateMonkeys(Monkey[] monkeys)
 {
     UIView.BeginAnimations ("monkeys");
     for(int i = 0; i < monkeys.Length; i ++){
         Monkey monkey = monkeys[i];
         MonkeyView view;
         MonkeyDictionary.TryGetValue(monkey,out view);
         if (view == null){
             view = new MonkeyView (monkey);
             MonkeyDictionary.Add(monkey,view);
         }
         view.Update (monkey, this.Bounds);
         this.InsertSubview(view,i);
     }
     UIView.CommitAnimations ();
 }
		public void Update(Monkey monkey, RectangleF bounds)
		{
			var transform = CGAffineTransform.MakeIdentity ();
			transform.Rotate (monkey.Rotation);
            transform.Scale (monkey.Scale, monkey.Scale);
			Transform = transform;

            // Convert location from top/left to center coords.
            var widthOffset = Frame.Width * 0.5f;
            var heightOffset = Frame.Width * 0.5f;

            var x = bounds.Width * monkey.X;
            var y = bounds.Height * monkey.Y;

            Center = new PointF (x + widthOffset, y + heightOffset);
		}
		public DropboxDatabase ()
		{
			Monkeys = new Monkey[0];
		}
		public void Update (Monkey monkey)
		{
			DBRecord record;
            var hasRecord = records.TryGetValue (monkey.Name, out record);
            var fields = monkey.ToDictionary ();
            var inserted = false;
            DBError error;
            if (hasRecord)
                record.Update (fields);
            else
                store.GetTable("monkeys").GetOrInsertRecord (monkey.Name, fields, inserted, out error);
			store.SyncAsync ();
		}
Exemplo n.º 7
0
 public void Update(Monkey monkey)
 {
     DBRecord record;
     records.TryGetValue (monkey.Name, out record);
     record.Update (monkey.ToDictionary ());
     store.SyncAsync (null);
 }
Exemplo n.º 8
0
 public DropboxDatabase()
 {
     Monkeys = new Monkey[0];
 }
Exemplo n.º 9
0
 public void UpdateMonkey(Monkey monkey)
 {
     DropboxDatabase.Shared.Update (monkey);
 }
 public void UpdateMonkey(Monkey monkey)
 {
     DropboxDatabase.Shared.Update(monkey);
 }