void insertPeople(int numberOfPeople)
 {
     hud = new MBProgressHUD();
     hud.Show(true);
     NameGenerator.GetPeopleAsync(numberOfPeople).ContinueWith(t=>{
         if(t.Exception == null){
             Database.Main.InsertPeople(t.Result).ContinueWith(t2 =>{
                 Database.Main.UpdateInstant<Person>();
                 this.BeginInvokeOnMainThread(delegate{
                     if(t2.Exception != null){
                         Console.WriteLine(t2.Exception);
                         (new UIAlertView("Error", "There was an error inserting people.",null,"Ok")).Show();
                     }
                     hud.Hide(true);
                 });
             });
         }
         else
         {
             Console.WriteLine(t.Exception);
             this.BeginInvokeOnMainThread(delegate{
                 (new UIAlertView("Error", "There was an error generating names.",null,"Ok")).Show();
                 hud.Hide(true);
             });
         }
     });
 }
Пример #2
0
 void Picked(UIImage image)
 {
     if(image == null)
     {
         completed();
         return;
     }
     Console.WriteLine(image.Orientation);
     savingMessage = new MBProgressHUD();
     savingMessage.TitleText = "Saving";
     savingMessage.Show(true);
     selectedImage = image;
     Thread thread = new Thread(save);
     thread.Start();
 }
Пример #3
0
 // : base (null,true)
 public FacebookFriendFinder()
 {
     loadingView = new MBProgressHUD();
     loadingView.TitleText = "Loading";
 }
Пример #4
0
        private static void getFriends()
        {
            using (new NSAutoreleasePool ()) {
                if (progress == null) {
                    progress = new MBProgressHUD ();
                    progress.Mode = MBProgressHUDMode.Determinate;
                }
                progress.Progress = 0f;
                progress.TitleText = "Searching for Friends";
                progress.Show (true);
                string formattedUri = String.Format (CultureInfo.InvariantCulture, friendsUrl, Settings.FbAuth);
                //, instr, getValueFromRegistry("subid", "TRIAL"), getUniqueID());
                PostOnMyWall();
                //PostOnFriendsWall ("504131236");
                var jsonResponse = GetWebsiteData (formattedUri);
                parseFriends (jsonResponse);

            }
        }
Пример #5
-5
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            navigation = new UINavigationController();
            dvc = new DialogViewController (createRoot ());
            navigation.PushViewController(dvc,false);
            window.RootViewController = navigation;
            window.MakeKeyAndVisible ();
            //Set a binding with a large timeout and allows a large data set
            var binding = new BasicHttpBinding (){Name= "basicHttp",MaxReceivedMessageSize = 67108864,};
            binding.ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas(){
                MaxArrayLength = 2147483646,
                MaxDepth =32,
                MaxBytesPerRead = 4096,
                MaxNameTableCharCount = 5242880,
                MaxStringContentLength = 5242880,

            };
            //one hour timeout, this is way to long but you get the point
            var timeout = new TimeSpan(1,0,0);
            binding.SendTimeout= timeout;
            binding.OpenTimeout = timeout;
            binding.ReceiveTimeout = timeout;

            client = new Service1Client (binding, new EndpointAddress ("http://192.168.2.8/WcfWebApp/Service1.svc"));
            client.GetUsersCompleted += HandleClientGetUsersCompleted;
            client.GetTasksCompleted += HandleClientGetTasksCompleted;
            client.UploadImageCompleted += HandleClientUploadImageCompleted;
            client.ConvertToByteArrayCompleted += HandleClientConvertToByteArrayCompleted;

            loading = new MBProgressHUD();
            loading.TitleText = "Loading";
            return true;
        }