コード例 #1
0
ファイル: Register.cs プロジェクト: Zorzin/KCK
 private bool GetSwim()
 {
     while (true)
     {
         ShowOnConsole("your divider for swim workout");
         SwimDivider = CheckData.ChengeDot(Console.ReadLine());
         if (!CheckEsc(SwimDivider))
         {
             return(false);
         }
         if (CheckRegister.CheckFloat(SwimDivider))
         {
             return(true);
         }
         Console.Clear();
         string s      = "Divider must be bigger than 0.";
         int    middle = (Console.WindowWidth - s.Length) / 2;
         Console.SetCursorPosition(middle, Console.CursorTop);
         Console.WriteLine(s);
     }
 }
コード例 #2
0
ファイル: Register.cs プロジェクト: Zorzin/KCK
 private bool GetGoal()
 {
     while (true)
     {
         ShowOnConsole("your monthly goal(km)");
         Goal = CheckData.ChengeDot(Console.ReadLine());
         if (!CheckEsc(Goal))
         {
             return(false);
         }
         if (CheckRegister.CheckFloat(Goal))
         {
             return(true);
         }
         Console.Clear();
         string s      = "Goal must be bigger than 0.";
         int    middle = (Console.WindowWidth - s.Length) / 2;
         Console.SetCursorPosition(middle, Console.CursorTop);
         Console.WriteLine(s);
     }
 }