private void rbtCF_Click(object sender, EventArgs e) { var rb = sender as RadioButton; CervicalFluid newCF = (CervicalFluid)rb.Tag; if (CurrentCF == newCF) { rb.Checked = false; currentCF = CervicalFluid.Undefined; } else { currentCF = newCF; } }
private DateTime TryUnderstandOvulationByCF(DateTime ovulCalend) { DateTime lastEggLikeCFDay = NoDate; for (int i = 0; i < 2 * NumberOfDaysToLookIn; i++) { DateTime day = ovulCalend.AddDays((-1 * NumberOfDaysToLookIn) + i); CervicalFluid cf = this.woman.CFs[day]; if (cf == CervicalFluid.Stretchy) { lastEggLikeCFDay = day; } } if (lastEggLikeCFDay != NoDate) { return(lastEggLikeCFDay); } return(NoDate); // CFs are not informative enough to understand the Ov. day. }
/// <summary> /// Get string from CF vlue. /// </summary> /// <param name="cf">Value to print.</param> /// <returns>String of the int VF value.</returns> protected string CF(CervicalFluid cf) { if (cf == CervicalFluid.Undefined) { return(string.Empty); } if (cf == CervicalFluid.Tacky) { return(TEXT.Get["CF_tacky"]); } if (cf == CervicalFluid.Stretchy) { return(TEXT.Get["CF_stretchy"]); } if (cf == CervicalFluid.Water) { return(TEXT.Get["CF_water"]); } return(string.Empty); }