Пример #1
0
        private void Btn_Generate_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(Txt_Min.Text) || (!int.TryParse(Txt_Min.Text, out _)))
            {
                Txt_Min.Text = rnd.MinDefault.ToString();
            }
            if (string.IsNullOrWhiteSpace(Txt_Max.Text) || (!int.TryParse(Txt_Max.Text, out _)))
            {
                Txt_Max.Text = rnd.MaxDefault.ToString();
            }

            rnd.Min      = Convert.ToUInt32(Txt_Min.Text);
            rnd.Max      = Convert.ToUInt32(Txt_Max.Text);
            Txt_Max.Text = rnd.Max.ToString();

            Txt_Result.Text = rnd.GetValue().ToString();
        }
 public static double GetValue(double minimum, double maximum)
 {
     return _randomizer.GetValue(minimum, maximum);
 }