示例#1
0
		void Btn_Config_LongClick (object sender, View.LongClickEventArgs e)
		{
			AlertDialog.Builder builder = new AlertDialog.Builder(this);

			builder.SetTitle("Deconnexion");

			builder.SetMessage("Voulez-vous vous déconnecter ?");
			builder.SetCancelable(false);
			builder.SetPositiveButton("Annuler", delegate {  });
			builder.SetNegativeButton("Déconnexion", delegate {
				DBRepository dbr = new DBRepository ();
				dbr.logout();
				Data.userAndsoft = null;
				Data.userTransics = null;
				File.AppendAllText(Data.log_file, "["+DateTime.Now.ToString("t")+"]"+"[LOGOUT]Coupure du service le "+DateTime.Now.ToString("G")+"\n");
				StopService (
					new Intent (this, typeof(ProcessDMS)).PutExtra("userAndsoft",Data.userAndsoft).PutExtra("userTransics",Data.userTransics)		
				);
				Intent intent = new Intent (this, typeof(MainActivity));
				this.StartActivity (intent);
				this.OverridePendingTransition (Resource.Animation.abc_slide_in_top,Resource.Animation.abc_slide_out_bottom);

			});
			builder.Show();
		}