public void setState(ApplicationState.AvailableStates newstate) { switch(newstate) { /* default: case AvailableStates.Unknown: // here be dragons. return; */ case AvailableStates.Main: doorStatus.update(); return; case AvailableStates.Twitter: users = Twitter.getUsersForList("tog_dublin","members"); return; case AvailableStates.PhotoGallery: if(gallery == null) { gallery = new PhotoGallery(); } return; case AvailableStates.Maps: if(poi_hackerspaces == null) { poi_hackerspaces = PointOfInterest.getPoints(POI_Kind.Hackerspace); } return; } if(onStateChangeDelegate != null) { onStateChangeDelegate(newstate); } }
private void setPhoto(PhotoGallery.Photo photo) { positionIndicator.Pages = _gallery.photos.Count; positionIndicator.CurrentPage = _gallery.index; photoTitle.Text = photo.title; WebClient wc = new WebClient(); Uri uri = new Uri(photo.path); wc.DownloadFile(uri, "avatar.png"); UIImage img = UIImage.FromFile("avatar.png"); image.Image = img; }
public override void ViewDidLoad () { base.ViewDidLoad (); _gallery = new PhotoGallery(); image.ContentMode = UIViewContentMode.ScaleToFill; setPhoto(_gallery.getCurrentPhoto()); // gestures (RIGHT) UISwipeGestureRecognizer sgrRight=new UISwipeGestureRecognizer(); sgrRight.AddTarget(this,RightSwipeSelector); sgrRight.Direction=UISwipeGestureRecognizerDirection.Right; sgrRight.Delegate=new SwipeRecogniserDelegate(); View.AddGestureRecognizer(sgrRight); // gestures (LEFT) UISwipeGestureRecognizer sgrLeft=new UISwipeGestureRecognizer(); sgrLeft.AddTarget(this,LeftSwipeSelector); sgrLeft.Direction=UISwipeGestureRecognizerDirection.Left; sgrLeft.Delegate=new SwipeRecogniserDelegate(); View.AddGestureRecognizer(sgrLeft); // Perform any additional setup after loading the view, typically from a nib. }