Пример #1
0
        private void PrintInfoExercises()
        {
            Button button = new Button();

            button.Text     = "Відправити";
            button.Clicked += SendButton_Clicked;
            if (objectExercises is ExercisesCount)
            {
                ExercisesCount currentExercises = (ExercisesCount)objectExercises;
                InfoEditor.Text       = String.Format($"{currentExercises.Name}\n{currentExercises.Information}");
                UsfullLinkEditor.Text = String.Format($"{currentExercises.LinkName}\n{currentExercises.LinkURL}");
                MissionLabel.Text     = currentExercises.PurposeToString();
                type = App.TypeExercises.Count;
                ResultStackLayout.Children.Add(new Entry()
                {
                    BackgroundColor = Color.White
                });
            }
            if (objectExercises is ExercisesApproach)
            {
                ExercisesApproach currentExercises = (ExercisesApproach)objectExercises;
                InfoEditor.Text       = String.Format($"{currentExercises.Name}\n{currentExercises.Information}");
                UsfullLinkEditor.Text = String.Format($"{currentExercises.LinkName}\n{currentExercises.LinkURL}");
                MissionLabel.Text     = currentExercises.PurposeToString();
                for (int i = 0; i < currentExercises.ApproachList.Count; i++)
                {
                    ResultStackLayout.Children.Add(new Entry()
                    {
                        BackgroundColor = Color.White
                    });
                }
                type = App.TypeExercises.Approach;
            }
            if (objectExercises is ExercisesTime)
            {
                ExercisesTime currentExercises = (ExercisesTime)objectExercises;
                InfoEditor.Text       = String.Format($"{currentExercises.Name}\n{currentExercises.Information}");
                UsfullLinkEditor.Text = String.Format($"{currentExercises.LinkName}\n{currentExercises.LinkURL}");
                MissionLabel.Text     = $"{currentExercises.Time.ToString()} = {currentExercises.PurposeToString()}s";
                ResultStackLayout.Children.Add(CreateNewTimePicker());
                type = App.TypeExercises.Time;
            }
            ResultStackLayout.Children.Add(button);
        }
Пример #2
0
        private void PrintInfoExercises()
        {
            if (exercises is ExercisesCount)
            {
                ExercisesCount exercisesCount = (ExercisesCount)exercises;

                NameEntry.Text         = exercisesCount.Name;
                InformationEditor.Text = exercisesCount.Information;
                NameLinkEntry.Text     = exercisesCount.LinkName;
                UrlLinkEntry.Text      = exercisesCount.LinkURL;
                TypeLabel.Text        += "Вправа на кількість";
                type = App.TypeExercises.Count;
                UpdateStackLayout.Children.Add(AddEntryFrame(exercisesCount.Purpose.ToString()));
            }
            else if (exercises is ExercisesApproach)
            {
                ExercisesApproach exercisesApproach = (ExercisesApproach)exercises;
                NameEntry.Text         = exercisesApproach.Name;
                InformationEditor.Text = exercisesApproach.Information;
                NameLinkEntry.Text     = exercisesApproach.LinkName;
                UrlLinkEntry.Text      = exercisesApproach.LinkURL;
                TypeLabel.Text        += "Вправа на підходи";
                for (int i = 0; i < exercisesApproach.ApproachList.Count; i++)
                {
                    UpdateStackLayout.Children.Add(AddEntryFrame(exercisesApproach.ApproachList[i].ToString()));
                }
                type = App.TypeExercises.Approach;
            }
            else if (exercises is ExercisesTime)
            {
                ExercisesTime exercisesTime = (ExercisesTime)exercises;

                Frame frame = new Frame()
                {
                    BackgroundColor = Color.Black,
                    Padding         = 2,
                };
                StackLayout stackLayout = new StackLayout()
                {
                    Orientation = StackOrientation.Horizontal
                };
                Image image = new Image()
                {
                    Source            = "ExMission.jpg",
                    VerticalOptions   = LayoutOptions.Center,
                    HorizontalOptions = LayoutOptions.Center,
                    Aspect            = Aspect.AspectFill,
                    HeightRequest     = 40,
                    WidthRequest      = 40
                };
                entry.Text              = exercisesTime.Time.TotalSeconds.ToString();
                entry.TextColor         = Color.White;
                entry.BackgroundColor   = Color.Black;
                entry.HorizontalOptions = LayoutOptions.FillAndExpand;
                stackLayout.Children.Add(image);
                stackLayout.Children.Add(entry);
                frame.Content = stackLayout;

                NameEntry.Text         = exercisesTime.Name;
                InformationEditor.Text = exercisesTime.Information;
                NameLinkEntry.Text     = exercisesTime.LinkName;
                UrlLinkEntry.Text      = exercisesTime.LinkURL;
                TypeLabel.Text        += "Вправа на час";
                type = App.TypeExercises.Time;
                UpdateStackLayout.Children.Add(frame);
                UpdateStackLayout.Children.Add(CreateNewTimePicker());
            }
        }