protected override void OnDialogClosed(bool positiveResult) { base.OnDialogClosed(positiveResult); if (positiveResult) { ulong paramValue; String strRounds = edittext.Text; if (!(ulong.TryParse(strRounds, out paramValue))) { Toast.MakeText(Context, Resource.String.error_param_not_number, ToastLength.Long).Show(); return; } if (paramValue < 1) { paramValue = 1; } Database db = App.Kp2a.GetDb(); ulong oldValue = ParamValue; if (oldValue == paramValue) { return; } ParamValue = paramValue; Handler handler = new Handler(); SaveDb save = new SaveDb(Context, App.Kp2a, new KdfNumberParamPreference.AfterSave(Context, handler, oldValue, this)); ProgressTask pt = new ProgressTask(App.Kp2a, Context, save); pt.Run(); } }
protected override void OnDialogClosed(bool positiveResult) { base.OnDialogClosed(positiveResult); if ( positiveResult ) { ulong rounds; String strRounds = RoundsView.Text; if (!(ulong.TryParse(strRounds,out rounds))) { Toast.MakeText(Context, Resource.String.error_rounds_not_number, ToastLength.Long).Show(); return; } if ( rounds < 1 ) { rounds = 1; } Database db = App.Kp2a.GetDb(); ulong oldRounds = db.KpDatabase.KeyEncryptionRounds; if (oldRounds == rounds) { return; } db.KpDatabase.KeyEncryptionRounds = rounds; Handler handler = new Handler(); SaveDb save = new SaveDb(Context, App.Kp2a, new AfterSave(Context, handler, oldRounds, this)); ProgressTask pt = new ProgressTask(App.Kp2a, Context, save); pt.Run(); } }