Esempio n. 1
0
		public static void ShowRealLoading(string title, string message, ManualResetEventSlim wait)
		{
			var hud = new LoadingHUDView(title, message);
			AppDelegateIPhone.AIphone.MainWnd.AddSubview(hud);
			hud.StartAnimating();			
			
			ThreadPool.QueueUserWorkItem(delegate {
				if (wait != null) 
					wait.Wait();
					
				s.InvokeOnMainThread(delegate {
					hud.StopAnimating ();
					hud.RemoveFromSuperview ();
					hud = null;
				});
			});
			
		}		
Esempio n. 2
0
		public static void ShowRealLoading(UIView view, string title, string message, Action action, Action mainThreadAction = null)
		{
			var hud = new LoadingHUDView(title, message);
			//view.AddSubview(hud);
			AppDelegateIPhone.AIphone.MainWnd.AddSubview(hud);
			hud.StartAnimating();
			
			/*
			// Show the UI, and on a callback, do the scaling, so the user gets an animation
			NSTimer.CreateScheduledTimer (0.1, delegate {
				
				if (action != null) 
					action();
				
				hud.StopAnimating ();
				hud.RemoveFromSuperview ();
				hud = null;
			});
			*/
			
			ThreadPool.QueueUserWorkItem(delegate {
				
				try
				{
					if (action != null) 
						action();
				}
				catch (Exception ex)
				{
					Util.LogException(title, ex);
				}
				
				s.InvokeOnMainThread(delegate {
					hud.StopAnimating ();
					hud.RemoveFromSuperview ();
					hud = null;
					
					if (mainThreadAction != null)
						mainThreadAction();
				});
			});
			
		}
Esempio n. 3
0
		public static void ShowMessage(UIView view, string title, string message, int timewait)
		{
			var hud = new LoadingHUDView(title, message);
			//view.AddSubview(hud);
			AppDelegateIPhone.AIphone.MainWnd.AddSubview(hud);
			hud.StartAnimating();
			
			// Show the UI, and on a callback, do the scaling, so the user gets an animation
			NSTimer.CreateScheduledTimer (timewait, delegate {
				
				hud.StopAnimating ();
				hud.RemoveFromSuperview ();
				hud = null;
			});				
		}