本文整理汇总了C#中Android.App.ProgressDialog.SetCancelable方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressDialog.SetCancelable方法的具体用法?C# ProgressDialog.SetCancelable怎么用?C# ProgressDialog.SetCancelable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.App.ProgressDialog
的用法示例。
在下文中一共展示了ProgressDialog.SetCancelable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateView
public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View view = inflater.Inflate(Resource.Layout.SignLayout, container, false);
Button clearButton = view.FindViewById<Button> (Resource.Id.clearButton);
Button sendButton = view.FindViewById<Button> (Resource.Id.sendButton);
EditText remarks = view.FindViewById<EditText> (Resource.Id.txtRemarks);
ToggleButton notification = view.FindViewById<ToggleButton> (Resource.Id.toggleNotifications);
SignView signView = view.FindViewById<SignView> (Resource.Id.signView);
mDialog = new ProgressDialog(this.Activity);
mDialog.SetMessage("Sending...");
mDialog.SetCancelable(false);
clearButton.Click += delegate {
signView.ClearCanvas();
};
sendButton.Click += delegate {
using (MemoryStream stream = new MemoryStream())
{
if (signView.CanvasBitmap().Compress(Bitmap.CompressFormat.Png, 100, stream))
{
byte[] image = stream.ToArray();
string base64signature = Convert.ToBase64String(image);
Backend.Current.send(base64signature, remarks.Text, notification.Activated, OnSendSuccess, OnSendFail);
mDialog.Show();
}
}
};
return view;
}
示例2: 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();
}
}
示例3: 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;
}
示例4: 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();
}
示例5: CreateProgressDialog
public static ProgressDialog CreateProgressDialog(string message, Activity activity)
{
var mProgressDialog = new ProgressDialog(activity, Resource.Style.LightDialog);
mProgressDialog.SetMessage(message);
mProgressDialog.SetCancelable(false);
mProgressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
return mProgressDialog;
}
示例6: OnClick
public void OnClick(View V)
{
ProgressDialog progress = new ProgressDialog(this);
try
{
switch(V.Id)
{
case Resource.Id.bSignIn :
{
isLogin=false;
Boolean blnValidate= FieldValidation();
if (blnValidate==true)
{
progress.Indeterminate = true;
progress.SetProgressStyle(ProgressDialogStyle.Spinner);
progress.SetMessage("Contacting server. Please wait...");
progress.SetCancelable(true);
progress.Show();
var progressDialog = ProgressDialog.Show(this, "Please wait...", "Checking Login info...", true);
new Thread(new ThreadStart(delegate
{
RunOnUiThread(() => ValidateSqluserpwd(etUsername.Text.ToString() , etpwd.Text.ToString()));
if (isLogin== true){
RunOnUiThread(() => Toast.MakeText(this, "Login detail found in system...", ToastLength.Short).Show());
}
RunOnUiThread(() => progressDialog.Hide());
})).Start();
}
break;
}
case Resource.Id.tvforget :
{
var toast = Toast.MakeText(this,"Forget link clicked",ToastLength.Short);
toast.Show();
break;
}
case Resource.Id.tvregister :
{
var myIntent = new Intent (this, typeof(MainActivity));
StartActivityForResult (myIntent, 0);
break;
}
}
}
catch (NullReferenceException ex) {
var toast = Toast.MakeText (this, ex.Message ,ToastLength.Short);
toast.Show ();
}
finally
{
// Now hide the progress dialog
progress.Dismiss();
}
}
示例7: Show
public void Show(Context context, string content)
{
var dialog = new ProgressDialog(context);
dialog.SetMessage(content);
dialog.SetCancelable(false);
dialog.Show();
System.Threading.Thread.Sleep (2000);
dialog.Hide ();
}
示例8: MakeCall
public static void MakeCall(CallEntity callEntity, Activity activity)
{
var category = callEntity.Category;
var choice = callEntity.Choice ?? "";
var detail = callEntity.Detail ?? "";
new AlertDialog.Builder(activity)
.SetTitle(category + " " + choice + " " + detail)
.SetMessage(Strings.CallSendMessage)
.SetPositiveButton(Strings.CallSend, delegate
{
ThreadPool.QueueUserWorkItem(o =>
{
activity.RunOnUiThread(() =>
{
dialog = new ProgressDialog(activity);
dialog.SetMessage(Strings.SpinnerDataSending);
dialog.SetCancelable(false);
dialog.Show();
});
try
{
ICall patientCall = new PatientCall();
// Assign the callid with the returned MongoDB id
callEntity._id = patientCall.MakeCall(callEntity);
activity.RunOnUiThread(() =>
{
// Call successfull, take the user to myCalls
activity.ActionBar.SelectTab(activity.ActionBar.GetTabAt(1));
SetNewCalls(callEntity);
dialog.Hide();
});
}
catch (Exception ex)
{
Console.WriteLine("ERROR making call: " + ex.Message);
activity.RunOnUiThread(() =>
{
dialog.Hide();
new AlertDialog.Builder(activity).SetTitle(Strings.Error)
.SetMessage(Strings.ErrorSendingCall)
.SetPositiveButton(Strings.OK,
delegate { }).Show();
});
}
});
})
.SetNegativeButton(Strings.Cancel, delegate {/* Do nothing */ })
.Show();
}
示例9: OnPreExecute
protected override void OnPreExecute()
{
base.OnPreExecute();
progDialog = new ProgressDialog(activity);
progDialog.SetMessage("Logging Out...");
progDialog.Indeterminate=false;
progDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
progDialog.SetCancelable(true);
progDialog.Show();
}
示例10: showProgressRootView
public void showProgressRootView(Activity _activity){
if (progressDialogParentRootView != null) {
progressDialogParentRootView.Hide ();
progressDialogParentRootView = null;
}
progressDialogParentRootView = ProgressDialog.Show (_activity, "", "", true);
progressDialogParentRootView.SetContentView(new ProgressBar(_activity));
progressDialogParentRootView.SetCancelable (true);
progressDialogParentRootView.Show ();
}
示例11: ShowProgressDialog
public static ProgressDialog ShowProgressDialog(Activity activity, int messageResId, /*int titleResId,*/ bool allowCancel, ProgressDialogStyle style=ProgressDialogStyle.Spinner)
{
ProgressDialog dialog = new ProgressDialog(activity);
dialog.SetProgressStyle(style);
//dialog.SetTitle(titleResId);
dialog.SetMessage(activity.Resources.GetString(messageResId));
dialog.SetCancelable(allowCancel);
dialog.SetCanceledOnTouchOutside(allowCancel);
dialog.Show();
return dialog;
}
示例12: CreateProgressDialog
private ProgressDialog CreateProgressDialog()
{
var progress = new ProgressDialog(this)
{
Indeterminate = true
};
progress.SetCancelable(false);
progress.SetProgressStyle(ProgressDialogStyle.Spinner);
progress.SetMessage("Contacting server. Please wait...");
return progress;
}
示例13: DownloadFileHelper
public DownloadFileHelper(Activity parent)
{
CallingActivity = parent;
progress = new ProgressDialog(CallingActivity);
progress.Indeterminate = false;
progress.SetProgressStyle(ProgressDialogStyle.Horizontal);
progress.SetMessage("Downloading. Please wait...");
progress.SetCancelable(false);
progress.Max = 100;
//OnFinishDownloadHandle += new OnFinishDownload (FinishDownload);
}
示例14: ExpenseFormArrayAdapter
public ExpenseFormArrayAdapter(Activity context)
: base()
{
this.context = context;
this.items = new List<SavedExpenseForm> ();
mDialog = new ProgressDialog(this.context);
mDialog.SetMessage("Loading...");
mDialog.SetCancelable(false);
Backend.Current.getExpenseForms(OnGetExpenseFormsSuccess, OnGetExpenseFormsFail);
mDialog.Show ();
}
示例15: ShowProgressDialog
private void ShowProgressDialog(ProgressDialog progressDialog, string message, bool show)
{
if (show)
{
progressDialog.Indeterminate = true;
progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
progressDialog.SetMessage(message);
progressDialog.SetCancelable(false);
progressDialog.Show();
}
else
progressDialog.Hide();
}