当前位置: 首页>>代码示例>>C#>>正文


C# App.ProgressDialog类代码示例

本文整理汇总了C#中Android.App.ProgressDialog的典型用法代码示例。如果您正苦于以下问题:C# ProgressDialog类的具体用法?C# ProgressDialog怎么用?C# ProgressDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProgressDialog类属于Android.App命名空间,在下文中一共展示了ProgressDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Busy

 public void Busy()
 {
     this.busyDlg = new ProgressDialog (this);
     this.busyDlg.SetMessage (Resources.GetString (Resource.String.busy_msg));
     this.busyDlg.SetCancelable (false);
     this.busyDlg.Show ();
 }
开发者ID:JohanOtto,项目名称:ModernHttpClient,代码行数:7,代码来源:MainActivity.cs

示例2: OnResume

		protected override void OnResume ()
		{
			base.OnResume ();

			Log.Debug (logTag, "ActivityBase.OnCreate.");

			if (!App.Current.IsInitialized){
			Log.Debug(logTag, "ActivityBase.App is NOT initialized");
				// show the loading overlay on the UI thread
				progress = ProgressDialog.Show(this, "Loading", "Please Wait...", true); 

				// when the app has initialized, hide the progress bar and call Finished Initialzing
				initializedEventHandler = (s, e) => {
					// call finished initializing so that any derived activities have a chance to do work
					RunOnUiThread( () => {
						this.FinishedInitializing();
						// hide the progress bar
						if (progress != null)
							progress.Dismiss();
					});
				};
				App.Current.Initialized += initializedEventHandler;

			} else {
				Log.Debug(logTag, "ActivityBase.App is initialized");
			}
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:27,代码来源:ActivityBase.cs

示例3: ProgressDialogHelper

		public ProgressDialogHelper(Context context) {
			this.progress = new ProgressDialog(context);
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.Indeterminate = false;
			progress.Progress = 99;
			progress.SetCanceledOnTouchOutside(false);
		}
开发者ID:MarcinSzyszka,项目名称:MobileSecondHand,代码行数:7,代码来源:ProgressDialogHelper.cs

示例4: ShowStatus

 public static ProgressDialog ShowStatus(Context cxt, string msg)
 {
     ProgressDialog status = new ProgressDialog(cxt);
     status.SetMessage(msg);
     status.Show();
     return status;
 }
开发者ID:Tomic-Tech,项目名称:JM.QingQi,代码行数:7,代码来源:DialogManager.cs

示例5: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            _contentView = inflater.Inflate(Resource.Layout.device_detail, null);
            _contentView.FindViewById<Button>(Resource.Id.btn_connect).Click += (sender, args) =>
                {
                    var config = new WifiP2pConfig
                        {
                            DeviceAddress = _device.DeviceAddress, 
                            Wps =
                                {
                                    Setup = WpsInfo.Pbc
                                }
                        };
                    if (_progressDialog != null && _progressDialog.IsShowing)
                        _progressDialog.Dismiss();

                    _progressDialog = ProgressDialog.Show(Activity, "Press back to cancel",
                                                          "Connecting to: " + _device.DeviceAddress, true, true);

                    ((IDeviceActionListener)Activity).Connect(config);
                };

            _contentView.FindViewById<Button>(Resource.Id.btn_disconnect).Click += (sender, args) => 
                ((IDeviceActionListener)Activity).Disconnect();

            _contentView.FindViewById<Button>(Resource.Id.btn_start_client).Click += (sender, args) =>
                {
                    var intent = new Intent(Intent.ActionGetContent);
                    intent.SetType("image/*");
                    StartActivityForResult(intent, ChooseFileResultCode);
                };

            return _contentView;
        }
开发者ID:pacificIT,项目名称:WiFiDirectSample,代码行数:34,代码来源:DeviceDetailFragment.cs

示例6: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            Button start = FindViewById<Button>(Resource.Id.startButton);
            Button stop = FindViewById<Button>(Resource.Id.stopButton);

            ProgressDialog pd = new ProgressDialog(this)
            {
                Indeterminate = true,
            };

            pd.SetMessage("Waiting");

            pd.SetButton("cancel", (s, e) => Stop(pd));
            pd.SetIcon(Resource.Drawable.Icon);

            //pd.SetCancelable(false);

            Drawable myIcon = Resources.GetDrawable(Resource.Animation.progress_dialog_icon_drawable_animation);
            pd.SetIndeterminateDrawable(myIcon);

            start.Click += delegate { Start(pd); };
            stop.Click += delegate { Stop(pd); };
        }
开发者ID:adbk,项目名称:spikes,代码行数:26,代码来源:Activity1.cs

示例7: OnResume

		protected async override void OnResume ()
		{
			try
			{
				base.OnResume ();

				ProgressDialogLogin = ProgressDialog.Show(this, "", "Loading...");

				await GetWorkshops();

				if (ProgressDialogLogin != null)
				{
					ProgressDialogLogin.Dismiss();
					ProgressDialogLogin = null;
				}
			}
			catch (Exception e) 
			{
				ErrorHandling.LogError (e, this);
			}
			finally 
			{
				if (ProgressDialogLogin != null)
				{
					ProgressDialogLogin.Dismiss();
					ProgressDialogLogin = null;
				}
			}
		}
开发者ID:rohan12111,项目名称:SDPHELPSAPP,代码行数:29,代码来源:MakeBookingListActivity.cs

示例8: CloseProgressDialog

    public static void CloseProgressDialog(Activity context) {
        if (!context.IsFinishing && _mProgressDialog != null)
        {
    		_mProgressDialog.Dismiss();
    	}
    	_mProgressDialog = null;
	}
开发者ID:Xushlin,项目名称:Xamarin-For-Android,代码行数:7,代码来源:DialogUitls.cs

示例9: OnCreateView

        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            //			Console.WriteLine("[{0}] OnCreateView Called: {1}", TAG, DateTime.Now.ToLongTimeString());
            View v = inflater.Inflate(Resource.Layout.fragment_photo, container, false);

            mImageView = v.FindViewById<ImageView>(Resource.Id.photoView);

            photoUrl = Activity.Intent.GetStringExtra(PhotoGalleryFragment.PHOTO_URL_EXTRA);

            photoUrl = photoUrl.Substring(0, photoUrl.Length-6) + ".jpg";
            photoFilename = new FlickrFetchr().GetFilenameFromUrl(photoUrl);

            ProgressDialog pg = new ProgressDialog(Activity);
            pg.SetMessage(Resources.GetString(Resource.String.loading_photo_message));
            pg.SetTitle(Resources.GetString(Resource.String.loading_photo_title));
            pg.SetCancelable(false);
            pg.Show();

            Task.Run(async () => {
                Bitmap image = await new FlickrFetchr().GetImageBitmapAsync(photoUrl, 0, new CancellationTokenSource().Token, photoFilename).ConfigureAwait(false);
                Activity.RunOnUiThread(() => {
                    mImageView.SetImageBitmap(image);
                    //Console.WriteLine("[{0}] File created: {1}", TAG, photoUrl);
                    pg.Dismiss();
                });
            });

            return v;
        }
开发者ID:yingfangdu,项目名称:BNR,代码行数:29,代码来源:PhotoFragment.cs

示例10: OnViewModelSet

		protected override void OnViewModelSet()
		{
			base.OnViewModelSet();

			// show a progress box if there is some work
			var events = ViewModel as EventsViewModel;
			if (events != null)
			{
				ProgressDialog progress = null;
				events.PropertyChanged += (sender, e) =>
				{
					if (e.PropertyName == "IsWorking")
					{
						if (events.IsWorking)
						{
							if (progress == null)
							{
								progress = new ProgressDialog(this);
								progress.SetProgressStyle(ProgressDialogStyle.Spinner);
								progress.SetMessage("Doing absolutely nothing in the background...");
								progress.Show();
							}
						}
						else
						{
							if (progress != null)
							{
								progress.Dismiss();
								progress = null;
							}
						}
					}
				};
			}
		}
开发者ID:Mazooma-Interactive-Games,项目名称:Flurry.Analytics,代码行数:35,代码来源:EventsView.cs

示例11: SaveButton_Click

    private async void SaveButton_Click(object sender, EventArgs ea)
    {
      var dialog = new ProgressDialog(this);
      dialog.SetMessage(Resources.GetString(Resource.String.Saving));
      dialog.SetCancelable(false);
      dialog.Show();

      try
      {
        Bindings.UpdateSourceForLastView();
        this.Model.ApplyEdit();
        var returnModel = await this.Model.SaveAsync();
        InitializeBindings(returnModel);
      }
      catch (Exception ex)
      {
        var alert = new AlertDialog.Builder(this);
        alert.SetMessage(string.Format(Resources.GetString(Resource.String.Error), ex.Message));
        alert.Show();
      }
      finally
      {
        dialog.Hide();
      }
    }
开发者ID:RodrigoGT,项目名称:csla,代码行数:25,代码来源:MainActivity.cs

示例12: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            var groupName = Intent.GetStringExtra("name");
            Title = groupName;
            GroupName = groupName;

            _contactRepo = new ContactRepository(this);

            _progressDialog = new ProgressDialog(this);
            _progressDialog.SetMessage("Loading Contacts.  Please wait...");
            _progressDialog.Show();

            Task.Factory
                .StartNew(() =>
                    _contactRepo.GetAllMobile())
                .ContinueWith(task =>
                    RunOnUiThread(() =>
                    {
                        if (task.Result != null)
                            DisplayContacts(task.Result);
                        _progressDialog.Dismiss ();
                    }));
        }
开发者ID:jheerman,项目名称:Prattle,代码行数:25,代码来源:NewSmsGroupActivity.cs

示例13: ConnectToRelay

		private async Task ConnectToRelay()
		{
			bool connected = false;

			var waitIndicator = new ProgressDialog(this) { Indeterminate = true };
			waitIndicator.SetCancelable(false);
			waitIndicator.SetMessage("Connecting...");
			waitIndicator.Show();

			try
			{
				var prefs = PreferenceManager.GetDefaultSharedPreferences(this);

				connected = await _remote.Connect(prefs.GetString("RelayServerUrl", ""), 
				                                  prefs.GetString("RemoteGroup", ""), 
				                                  prefs.GetString("HubName", ""));
			}
			catch (Exception)
			{
			}
			finally
			{
				waitIndicator.Hide();
			}

			Toast.MakeText(this, connected ? "Connected!" : "Unable to connect", ToastLength.Short).Show();
		}
开发者ID:JonathanTLH,项目名称:PanTiltZoomSystem,代码行数:27,代码来源:RemoteActivity.cs

示例14: fnGetProfileInfoFromGoogle

		async Task<bool> fnGetProfileInfoFromGoogle()
		{ 
			progress =  ProgressDialog.Show (this,"","Please wait..."); 
			bool isValid=false;
			//Google API REST request
			string userInfo = await fnDownloadString (string.Format(googUesrInfoAccessleUrl, access_token ));  
			if ( userInfo != "Exception" )
			{ 
				googleInfo = JsonConvert.DeserializeObject<GoogleInfo> ( userInfo );   
				isValid = true;
			}
			else
			{ 
				if ( progress != null )
				{
					progress.Dismiss ();
					progress = null;
				}   
				isValid = false;
				Toast.MakeText ( this , "Connection failed! Please try again" , ToastLength.Short ).Show (); 
			}
			if ( progress != null )
			{
				progress.Dismiss ();
				progress = null;
			}  
			return isValid;
		}
开发者ID:suchithm,项目名称:LoginByGoogle_Xamarin,代码行数:28,代码来源:MainActivity.cs

示例15: OnCreate

        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // shows a spinner while it gets polls from database
            var progressDialog = new ProgressDialog(this);
            progressDialog.Show();
            {
                try
                {
                    // gets all the polls from the database
                    polls = await VotingService.MobileService.GetTable<Poll>().ToListAsync();
                }
                catch (Exception exc)
                {
                    // error dialog that shows if something goes wrong
                    var errorDialog = new AlertDialog.Builder(this).SetTitle("Oops!").SetMessage("Something went wrong " + exc.ToString()).SetPositiveButton("Okay", (sender1, e1) =>
                    {

                    }).Create();
                    errorDialog.Show();
                }
            };
            // ends spinner on completion
            progressDialog.Dismiss();

            // created table for polls
            ListAdapter = new ArrayAdapter<Poll>(this, Android.Resource.Layout.SimpleListItem1, polls);
        }
开发者ID:nickpeppers,项目名称:VotingPoll,代码行数:29,代码来源:ViewPollsActivity.cs


注:本文中的Android.App.ProgressDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。