private void FrmSumFibFac_Load(object sender, EventArgs e) { TxtLen.Text = "10"; CbxFibonnaci.DropDownStyle = ComboBoxStyle.DropDownList; // DropDownList makes it ReadOnly this.AcceptButton = BtnCalculate; BtnCalculate.PerformClick(); }
protected void TxtTAcc_TextChanged(object sender, EventArgs e) { try { if (Convert.ToInt32(TxtFAcc.Text) > Convert.ToInt32(TxtTAcc.Text)) { WebMsgBox.Show("Invalid FROM and TO Account Number....!", this.Page); TxtFAcc.Text = ""; TxtTAcc.Text = ""; TxtFAccName.Text = ""; TxtTAccName.Text = ""; TxtFAcc.Focus(); return; } TxtTAccName.Text = BD.AccName(TxtTAcc.Text, TxtFPRD.Text, TxtTPRD.Text, Session["BRCD"].ToString()); BtnCalculate.Focus(); } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
protected void BtnRecalculate_Click(object sender, EventArgs e) { try { int RS = 0; RS = SC.Recalculate("RECALC", Session["MID"].ToString(), Session["EntryDate"].ToString(), Session["BRCD"].ToString()); if (RS > 0) { WebMsgBox.Show("Calculated data removed, " + Session["LOGINCODE"].ToString() + " can calculate from start...!", this.Page); BtnCalculate.Focus(); } else { WebMsgBox.Show("Data not available on " + Session["EntryDate"].ToString() + " for User " + Session["LOGINCODE"].ToString() + " ...!", this.Page); BtnCalculate.Focus(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
void CreateBindings() { BtnCalculate.SetCommand("Click", ViewModel.BtnCalculateResults); //SpinBodyCondition.SetCommand<AdapterView.ItemSelectedEventArgs>("ItemSelected", ItemSelectedCommand); SpinBodyCondition.SetBinding(() => SpinBodyCondition.SelectedItemPosition).ObserveSourceEvent <AdapterView.ItemSelectedEventArgs>("ItemSelected").WhenSourceChanges(() => Console.WriteLine("SelectedItem = {0}", SpinBodyCondition.SelectedItemPosition)); SpinFoundAir.SetCommand <AdapterView.ItemSelectedEventArgs>("ItemSelected", ItemSelectedCommand); SpinFromWater.SetCommand <AdapterView.ItemSelectedEventArgs>("ItemSelected", ItemSelectedCommand); SpinFoundWater.SetCommand <AdapterView.ItemSelectedEventArgs>("ItemSelected", ItemSelectedCommand); // fools the linker into thinking we're using the events in release mode if (falseFlag) { SpinBodyCondition.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => { } } ; } void PropogateSpinners() { var context = BtnCalculate.Context; var body = new ArrayAdapter(context, Android.Resource.Layout.SimpleSpinnerItem, ViewModel.GetBodyLayers.ToArray()); body.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); SpinBodyCondition.Adapter = body; var iw = new ArrayAdapter(context, Android.Resource.Layout.SimpleSpinnerItem, ViewModel.GetFoundWater.ToArray()); iw.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); SpinBodyCondition.Adapter = iw; var pw = new ArrayAdapter(context, Android.Resource.Layout.SimpleSpinnerItem, ViewModel.GetPulledWater.ToArray()); pw.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); SpinBodyCondition.Adapter = pw; var ia = new ArrayAdapter(context, Android.Resource.Layout.SimpleSpinnerItem, ViewModel.GetFoundAir.ToArray()); ia.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); SpinBodyCondition.Adapter = ia; } }
private void TxtLen_DoubleClick(object sender, EventArgs e) { TxtLen.Text = (int.Parse(TxtLen.Text) + 1).ToString(); BtnCalculate.PerformClick(); }
private void SettingsChanged(NSNotification obj) { var isNightMode = userDefaults.BoolForKey("night_mode"); if (isNightMode) { //Changing the background and StatusBar View.BackgroundColor = UIColor.DarkGray; //It wasn't necesary anymore when adding the Navigation Controller. //UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent; var navigationBar = this.NavigationController.NavigationBar; navigationBar.TintColor = UIColor.Black; navigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.Blue }; BtnGoToSettings.TintColor = UIColor.Red; //Chaning the main controls. //The TextFields. TxtNumber1.TextColor = UIColor.White; TxtNumber2.TextColor = UIColor.White; TxtNumber1.Layer.BorderColor = UIColor.White.CGColor; TxtNumber1.Layer.BorderWidth = 1f; TxtNumber2.Layer.BorderColor = UIColor.White.CGColor; TxtNumber2.Layer.BorderWidth = 1f; TxtNumber1.KeyboardAppearance = UIKeyboardAppearance.Dark; TxtNumber2.KeyboardAppearance = UIKeyboardAppearance.Dark; AddDoneButtonToKeyboard(true); //Then the other controls. LblResult.TextColor = UIColor.White; SldOperator.TintColor = UIColor.Red; BtnCalculate.SetTitleColor(UIColor.Green, UIControlState.Normal); //Changing the miscellaneous controls. LblNumber1.TextColor = UIColor.White; LblNumber2.TextColor = UIColor.White; LblAddition.TextColor = UIColor.White; LblSubstraction.TextColor = UIColor.White; LblMultiplication.TextColor = UIColor.White; LblDivision.TextColor = UIColor.White; } else { //Changing the background and StatusBar View.BackgroundColor = UIColor.White; //It wasn't necesary anymore when adding the Navigation Controller. //UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.Default; var navigationBar = this.NavigationController.NavigationBar; navigationBar.TintColor = View.TintColor; navigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.Black }; BtnGoToSettings.TintColor = View.TintColor; //Chaning the main controls. //The TextFields. TxtNumber1.TextColor = UIColor.Black; TxtNumber2.TextColor = UIColor.Black; TxtNumber1.Layer.BorderColor = UIColor.Black.CGColor; TxtNumber1.Layer.BorderWidth = 0; TxtNumber2.Layer.BorderColor = UIColor.Black.CGColor; TxtNumber2.Layer.BorderWidth = 0; TxtNumber1.KeyboardAppearance = UIKeyboardAppearance.Default; TxtNumber2.KeyboardAppearance = UIKeyboardAppearance.Default; AddDoneButtonToKeyboard(false); //Then the other controls. LblResult.TextColor = UIColor.Black; SldOperator.TintColor = View.TintColor; BtnCalculate.SetTitleColor(View.TintColor, UIControlState.Normal); //Changing the miscellaneous controls. LblNumber1.TextColor = UIColor.Black; LblNumber2.TextColor = UIColor.Black; LblAddition.TextColor = UIColor.Black; LblSubstraction.TextColor = UIColor.Black; LblMultiplication.TextColor = UIColor.Black; LblDivision.TextColor = UIColor.Black; } }
void ReleaseDesignerOutlets() { if (BtnCalculate != null) { BtnCalculate.Dispose(); BtnCalculate = null; } if (LblAddition != null) { LblAddition.Dispose(); LblAddition = null; } if (LblDivision != null) { LblDivision.Dispose(); LblDivision = null; } if (LblMultiplication != null) { LblMultiplication.Dispose(); LblMultiplication = null; } if (LblNumber1 != null) { LblNumber1.Dispose(); LblNumber1 = null; } if (LblNumber2 != null) { LblNumber2.Dispose(); LblNumber2 = null; } if (LblResult != null) { LblResult.Dispose(); LblResult = null; } if (LblSubstraction != null) { LblSubstraction.Dispose(); LblSubstraction = null; } if (SldOperator != null) { SldOperator.Dispose(); SldOperator = null; } if (TxtNumber1 != null) { TxtNumber1.Dispose(); TxtNumber1 = null; } if (TxtNumber2 != null) { TxtNumber2.Dispose(); TxtNumber2 = null; } if (BtnGoToSettings != null) { BtnGoToSettings.Dispose(); BtnGoToSettings = null; } }