Beispiel #1
0
        public void ID499Tests()
        {
            Assert.AreEqual(4, Excercises.ID499_Tests(2, 2));
            Assert.AreEqual(1, Excercises.ID499_Tests(1289312391, 0));
            Assert.AreEqual(1, Excercises.ID499_Tests(1, 2321323123));
            Assert.AreEqual(2, Excercises.ID499_Tests(2, 324324345));
            Assert.AreEqual(1, Excercises.ID499_Tests(3, 435435436));
            Assert.AreEqual(4, Excercises.ID499_Tests(4, 9080237));
            Assert.AreEqual(5, Excercises.ID499_Tests(5, 2163062));
            Assert.AreEqual(6, Excercises.ID499_Tests(6, 96123412));
            Assert.AreEqual(7, Excercises.ID499_Tests(7, 921638125));
            Assert.AreEqual(2, Excercises.ID499_Tests(8, 2128963591));
            Assert.AreEqual(9, Excercises.ID499_Tests(9, 21538123));
            Assert.AreEqual(0, Excercises.ID499_Tests(0, 182931253));

            Assert.AreEqual(1, Excercises.ID499_Tests(0, 0));
            //Assert.AreEqual(1, Excercises.ID499_Tests(3, 0));
            //Assert.AreEqual(0, Excercises.ID499_Tests(0, 5));
            //Assert.AreEqual(0, Excercises.ID499_Tests(10, 1));
            //Assert.AreEqual(1, Excercises.ID499_Tests(1, 44));
            //Assert.AreEqual(6, Excercises.ID499_Tests(2, 12));
            //Assert.AreEqual(3, Excercises.ID499_Tests(3, 5));
            //Assert.AreEqual(9, Excercises.ID499_Tests(99999999, 3));
            //Assert.AreEqual(1, Excercises.ID499_Tests(11111111, 99999999));
            //Assert.AreEqual(1, Excercises.ID499_Tests(22222, 0));
        }
Beispiel #2
0
        private void RemoveAction(object obj)
        {
            Excercise excercise = obj as Excercise;

            if (excercise != null)
            {
                Excercises.Remove(excercise);
            }
        }
Beispiel #3
0
 private void AddExcerciseToPlan(Excercise e)
 {
     try
     {
         Excercises.Add(e);
     }
     catch (Exception ex)
     {
         Application.Current.MainPage.DisplayAlert("Alert", ex.Message, "ok");
     }
 }
Beispiel #4
0
 public Practics()
 {
     InitializeComponent();
     WindowState     = FormWindowState.Maximized;
     FormBorderStyle = FormBorderStyle.None;
     using (var reader = new StreamReader(Program.Adress))
     {
         var serializer = new XmlSerializer(typeof(Excercises));
         _excercises = serializer.Deserialize(reader) as Excercises;
     }
     NewExercise();
     MessageBox.Show("ВНИМАНИЕ! На ввод правильного ответа для каждой задачи дано 3(три) попытки. Ответ вводить с точность до тысячных(три знака после запятой), разделяя целую и дробную части запятой(,)(Например: 32,000)");
 }
        public override void Init(object initData)
        {
            var data = initData as dynamic;

            TodaysPlan          = data.plan;
            TodaysTraining.Date = data.date;

            foreach (var item in TodaysPlan.Excercises)
            {
                Excercises.Add(item);
            }
            TodaysTraining.Plan = TodaysPlan.PlanName;
        }
        public void Add(Activity activity, DateTime start, DateTime end)
        {
            var act = Activities.SingleOrDefault(a => a.Name == activity.Name);

            if (act == null)
            {
                Activities.Add(activity);
                var excercise = new Excercise(start, end, activity, User);
                Excercises.Add(excercise);
            }
            else
            {
                var excercise = new Excercise(start, end, act, User);
                Excercises.Add(excercise);
            }

            Save();
        }
Beispiel #7
0
        private void UpdateExcercise(ExcerciseChanged ech)
        {
            int index = Excercises.IndexOf(ClickedItem);

            Excercises[index] = ech.ChangedExcercise;
        }
Beispiel #8
0
 static void Main(string[] args)
 {
     Excercises.Do3();
     Console.ReadLine();
 }