Exemple #1
0
        protected override void OnAppearing()
        {
            questionEntry.Focus();
            if (_questionSelected != null)
            {
                if (_questionSelected.Type == TypeQuestion.MultiChoice)
                {
                    pickerSelectionType.Title = Lang.Resource.typePickerMulti_2;
                    Type_multi = "Multi-select (Check Boxs)";
                }
                entry1.Text = _questionSelected.answer[0];
                entry2.Text = _questionSelected.answer[1];
                if (_questionSelected.answer[_questionSelected.answer.Length - 1].Equals("Other"))
                {
                    switchOtherAnswer.IsToggled = true;
                    for (int i = 2; i < _questionSelected.answer.Length - 1; i++)
                    {
                        stackAnswerChoice.Children.Add(GetElements.GetAnswerChoics(_questionSelected.answer[i]));
                    }
                }
                else
                {
                    for (int i = 2; i < _questionSelected.answer.Length; i++)
                    {
                        stackAnswerChoice.Children.Add(GetElements.GetAnswerChoics(_questionSelected.answer[i]));
                    }
                }
            }

            base.OnAppearing();
        }
 private void AddQuestion(List <Question> listQuestions, int i)
 {
     if (listQuestions.ElementAt(i) is Text_Question)
     {
         Text_Question question = (Text_Question)listQuestions.ElementAt(i);
         stackQuestions.Children.Add(GetElements.GetTextQuestion(i + 1 + "- " + question.questionProperty + " ?", false, false));
         AddAnalyzeButton(i, TypeQuestion.Text);
     }
     else if (listQuestions.ElementAt(i) is Multible)
     {
         Multible question = (Multible)listQuestions.ElementAt(i);
         if (question.typeQuestion_properties.ToString().Contains("Multible"))
         {
             stackQuestions.Children.Add(GetElements.GetMultiChoices(false, i + 1 + "- " + question.title_property + " ?", question.answer, false, false));
         }
         else if (question.Type.Equals(TypeQuestion.MultiChoice))
         {
             stackQuestions.Children.Add(GetElements.GetMultiChoices(true, i + 1 + "- " + question.title_property + " ?", question.answer, false, false));
         }
         else if (question.Type.Equals(TypeQuestion.DropDown))
         {
             stackQuestions.Children.Add(GetElements.GetDropDownQuestion(i + 1 + "- " + question.title_properties + " ?", question.answer.ToList(), false, false));
         }
         AddAnalyzeButton(i, TypeQuestion.Multible);
     }
     else if (listQuestions.ElementAt(i) is Slider_Question)
     {
         Slider_Question question = (Slider_Question)listQuestions.ElementAt(i);
         stackQuestions.Children.Add(
             GetElements.GetSlider(question.Min_Value_Property, question.Max_Value_Property, i + 1 + "- " + question.title_property + " ?", false, false)
             );
         AddAnalyzeButton(i, TypeQuestion.Slider);
     }
 }
 protected override void OnAppearing()
 {
     questionEntry.Focus();
     if (_questionSelected != null)
     {
         entry1.Text = _questionSelected.answer[0];
         entry2.Text = _questionSelected.answer[1];
         if (_questionSelected.answer[_questionSelected.answer.Length - 1].Equals("Other"))
         {
             switchOtherAnswer.IsToggled = true;
             for (int i = 2; i < _questionSelected.answer.Length - 1; i++)
             {
                 stackAnswerChoice.Children.Add(GetElements.GetAnswerChoics(_questionSelected.answer[i]));
             }
         }
         else
         {
             for (int i = 2; i < _questionSelected.answer.Length; i++)
             {
                 stackAnswerChoice.Children.Add(GetElements.GetAnswerChoics(_questionSelected.answer[i]));
             }
         }
     }
     base.OnAppearing();
 }
Exemple #4
0
        // Olga, change
        public async Task UpdateAsync(UpdateMailingModel updateModel)
        {
            if (updateModel == null)
            {
                throw new ExceptionTypes.NullValueException();
            }
            if ((updateModel.FinishId.HasValue && updateModel.FinishId.Value < 1) ||
                updateModel.MailingId < 1)
            {
                throw new ExceptionTypes.IncorrectIdException();
            }


            if (!await _repository.ExistAsync(updateModel.MailingId))
            {
                throw new ExceptionTypes.MailingNotExistException();
            }

            CheckDate(updateModel.StartDate);

            if (updateModel.TextId != null)
            {
                GetElements <Text> getTexts = _textRepository.GetTextsAsyncById;
                await AddElement(updateModel.MailText, updateModel.TextId, getTexts, new ExceptionTypes.TextNotExistException());
            }

            if (updateModel.WorksId != null)
            {
                GetElements <ControlEvent> getElements = _eventRepository.GetControlEventsAsyncById;
                await AddElement(updateModel.Works, updateModel.WorksId, getElements, new ExceptionTypes.ControlEventNotExistException());

                foreach (var work in updateModel.Works)
                {
                    var text = await _textRepository.CreateTextAsync(new Text()
                    {
                        RememberAboutDeadline = "Контрольное мероприятие " + work.ControlEventId,
                        InfomationPart        = "Дедлайн:  " + work.Date
                    });

                    updateModel.MailText.Add(text);
                }
            }

            if (updateModel.FinishId.HasValue)
            {
                var control = await _eventRepository.GetControlEventAsync(updateModel.FinishId.Value);

                if (control == null)
                {
                    throw new ExceptionTypes.ControlEventNotExistException();
                }

                updateModel.FinishWork = control;
            }


            await _repository.UpdateAsync(updateModel);
        }
        public async Task <IEnumerable <Element> > Handle(GetElements request, CancellationToken cancellationToken)
        {
            var elements = await _elementsContext
                           .Elements
                           .AsNoTracking()
                           .ToListAsync(cancellationToken);

            return(elements);
        }
Exemple #6
0
        private void Init()
        {
            var _question = ((Multible)_survey.Questions[index]);

            lblQuestion.Text = "  - " + _question.title + " ? ";
            for (int j = 0; j < Users_answers.Length; j++)
            {
                int progress = (Users_answers[j].Count * 100) / _survey.Number_of_Participants;
                stackAnswers.Children.Add(GetElements.GetAnswers_byUsers_forMulible(progress, j + 1, Users_answers[j], _question.answer[j]));
            }
        }
Exemple #7
0
    public Dictionary <BIM_Service.ElementType, List <BIM_Service.Element> > GetElements(List <BIM_Service.ElementType> elementTypes)
    {
        Dictionary <BIM_Service.ElementType, List <BIM_Service.Element> > result = new Dictionary <BIM_Service.ElementType, List <BIM_Service.Element> >();

        foreach (BIM_Service.ElementType type in elementTypes)
        {
            GetElements elements = new GetElements();
            result.Add(type, elements.Get(type));
        }

        return(result);
    }
Exemple #8
0
        // Olga, Change:
        public async Task <MailingsGeneratorDomain.Models.Mailing> CreateMailingAsync(
            MailingsGeneratorDomain.Models.Mailing mail)
        {
            if (mail == null)
            {
                throw new ExceptionTypes.NullValueException();
            }
            if (mail.CourseName == null)
            {
                throw new ExceptionTypes.IncorrectNameException();
            }

            CheckDate(mail.StartDate);

            if (mail.TextId != null)
            {
                GetElements <Text> getTexts = _textRepository.GetTextsAsyncById;
                await AddElement(mail.MailText, mail.TextId, getTexts, new ExceptionTypes.TextNotExistException());
            }

            if (mail.WorksId != null)
            {
                GetElements <ControlEvent> getElements = _eventRepository.GetControlEventsAsyncById;
                await AddElement(mail.Works, mail.WorksId, getElements, new ExceptionTypes.ControlEventNotExistException());

                foreach (var work in mail.Works)
                {
                    var text = await _textRepository.CreateTextAsync(new Text()
                    {
                        RememberAboutDeadline = "Контрольное мероприятие " + work.ControlEventId,
                        InfomationPart        = "Дедлайн:  " + work.Date
                    });

                    mail.MailText.Add(text);
                }
            }

            if (mail.FinishWorkId != 0)
            {
                var finishWork = await _eventRepository.GetControlEventAsync(mail.FinishWorkId);

                if (finishWork == null)
                {
                    throw new ExceptionTypes.ControlEventNotExistException();
                }

                mail.FinishWork = finishWork;
            }

            return(await _repository.CreateMailingAsync(mail));
        }
Exemple #9
0
        private async Task AddElement <T>(List <T> list,
                                          List <int> idList, GetElements <T> getElements, Exception exception)
        {
            if (idList != null)
            {
                var listOfData = await getElements(idList);

                if (listOfData.Count != idList.Count)
                {
                    throw exception;
                }

                foreach (var element in listOfData)
                {
                    list.Add(element);
                }
            }
        }
        private void Init(int progress)
        {
            var _question = ((Slider_Question)_survey.Questions[index]);

            lblQuestion.Text = "  - " + _question.title + " ? ";
            for (int j = 0; j < listMultibleAnswer.Count; j++)
            {
                stackAnswers.Children.Add(GetElements.GetAnswers_byUsers(_question.List_multiable_Answer.ElementAt(j).choosen_answer, _question.List_multiable_Answer.ElementAt(j).user.UserName));
                stackAnswers.Children.Add(new Label {
                    BackgroundColor = Color.FromHex("a7cefb"), HeightRequest = 2
                });
            }
            stackAnswers.Children.Add(new Label {
                Text = Lang.Resource.RatioSlider, FontAttributes = FontAttributes.Bold, FontSize = 20, TextColor = Color.FromHex("1fe887")
            });

            stackAnswers.Children.Add(
                new Grid
            {
                Children =
                {
                    new CrossPieChartView
                    {
                        Progress                = progress,
                        ProgressColor           = Color.Green,
                        ProgressBackgroundColor = Color.FromHex("#EEEEEEEE"),
                        StrokeThickness         = Device.OnPlatform(10, 20, 80),
                        Radius          = Device.OnPlatform(100, 180, 160),
                        BackgroundColor = Color.White
                    },
                    new Label
                    {
                        Text              = progress + "%",
                        Font              = Font.BoldSystemFontOfSize(NamedSize.Large),
                        FontSize          = 70,
                        VerticalOptions   = LayoutOptions.Center,
                        HorizontalOptions = LayoutOptions.Center,
                        TextColor         = Color.Black
                    }
                }
            }
                );
        }
 private void AddAnswerChoiceRecognizer_Tapped(object sender, EventArgs e)
 {
     stackAnswerChoice.Children.Add(GetElements.GetAnswerChoics(""));
     count_Visable++;
 }
Exemple #12
0
        public static void DoRestore()
        {
            EntryPoint.MyPed = Game.LocalPlayer.Character;

            try
            { // Catch all
                // Check if there is an xml file
                if (File.Exists(EntryPoint.XMLpath))
                {
                    try
                    { // Do a bit of housework
                        NativeFunction.Natives.CLEAR_ALL_PED_PROPS(EntryPoint.MyPed);

                        if (Game.LocalPlayer.Character.IsInAnyVehicle(true))
                        {
                            //Delete vehicle to pevent taking it with us
                            Game.LocalPlayer.Character.CurrentVehicle.Delete();
                        }
                        else
                        {
                            try { Game.LocalPlayer.Character.LastVehicle.Delete(); } catch { }
                        }
                    }
                    catch (Exception e) { EntryPoint.ErrorLogger(e, "Restore", "Error doing housework"); }

                    XDocument xdocument = XDocument.Load(EntryPoint.XMLpath);

                    try
                    { ////// RESTORE VEHICLE ///////////////////////////////////////////////////////////////
                        IEnumerable <XElement> MyVehicleElements = xdocument.Descendants("MyVehicleElements");
                        foreach (XElement GetElements in MyVehicleElements)
                        {
                            EntryPoint.InVehicle = (Boolean)GetElements.Element("InVehicle");
                            Vector3 MyVehLoc = new Vector3((float)GetElements.Element("MyVehLocX"),
                                                           (float)GetElements.Element("MyVehLocY"),
                                                           (float)GetElements.Element("MyVehLocZ"));

                            if ((string)GetElements.Element("MyVehicle") != "None")
                            {
                                Lookups.LookupVehicles.TryGetValue((string)GetElements.Element("MyVehicle"), out String Vehresult);

                                if (Vehresult == null)
                                {
                                    try
                                    {
                                        EntryPoint.GetVehicle = new Vehicle((string)GetElements.Element("MyVehicle"), MyVehLoc, (float)GetElements.Element("MyVehLocH"));
                                    }
                                    catch (Exception e)
                                    {
                                        EntryPoint.InVehicle = false;  // Vehicle not restored, so forget warp to vehicle
                                        EntryPoint.ErrorLogger(e, "Restore", "Error restoring vehicle");
                                    }
                                }
                                else
                                {
                                    try
                                    {
                                        EntryPoint.GetVehicle = new Vehicle(Vehresult, MyVehLoc, (float)GetElements.Element("MyVehLocH"));
                                    }
                                    catch (Exception e)
                                    {
                                        EntryPoint.InVehicle = false;  // Vehicle not restored, so forget warp to vehicle
                                        EntryPoint.ErrorLogger(e, "Restore", "Error restoring vehicle");
                                    }
                                }

                                // Try and set vehicle parameters
                                try
                                {
                                    EntryPoint.GetVehicle.PrimaryColor = Color.FromArgb((Int16)GetElements.Element("MyVehPriR"),
                                                                                        (Int16)GetElements.Element("MyVehPriG"),
                                                                                        (Int16)GetElements.Element("MyVehPriB"));
                                    EntryPoint.GetVehicle.SecondaryColor = Color.FromArgb((Int16)GetElements.Element("MyVehSecR"),
                                                                                          (Int16)GetElements.Element("MyVehSecG"),
                                                                                          (Int16)GetElements.Element("MyVehSecB"));
                                    EntryPoint.GetVehicle.RimColor = Color.FromArgb((Int16)GetElements.Element("MyVehRimR"),
                                                                                    (Int16)GetElements.Element("MyVehRimG"),
                                                                                    (Int16)GetElements.Element("MyVehRimB"));
                                    EntryPoint.GetVehicle.DirtLevel = (float)GetElements.Element("MyVehDirt");
                                    NativeFunction.Natives.SetVehicleLivery <int>(EntryPoint.GetVehicle, (Int16)GetElements.Element("MyVehLivery"));
                                    NativeFunction.Natives.SetVehicleWindowTint <int>(EntryPoint.GetVehicle, (Int16)GetElements.Element("MyVehTint"));
                                    EntryPoint.GetVehicle.LicensePlate = (string)GetElements.Element("MyVehPlate");
                                    NativeFunction.Natives.SetVehicleNumberPlateTextIndex <short>(EntryPoint.GetVehicle, (short)GetElements.Element("MyVehPlateStyle"));
                                    EntryPoint.GetVehicle.Health = (Int16)GetElements.Element("MyVehHealth");
                                    NativeFunction.Natives.SetVehicleBodyHealth <float>(EntryPoint.GetVehicle, (float)GetElements.Element("MyVehBodyHealth"));
                                    EntryPoint.GetVehicle.EngineHealth   = (float)GetElements.Element("MyVehEngineHealth");
                                    EntryPoint.GetVehicle.FuelTankHealth = (float)GetElements.Element("MyVehFuelTankHealth");
                                    MyVehRadio = (string)GetElements.Element("MyVehRadio"); //Get radio to set later
                                    if (EntryPoint.VehicleGodMode == true)
                                    {
                                        NativeFunction.Natives.SET_VEHICLE_FIXED(EntryPoint.GetVehicle);
                                        NativeFunction.Natives.SET_ENTITY_INVINCIBLE(EntryPoint.GetVehicle, true);
                                        NativeFunction.Natives.SET_VEHICLE_STRONG(EntryPoint.GetVehicle, true);
                                        NativeFunction.Natives.SET_VEHICLE_CAN_BREAK(EntryPoint.GetVehicle, false);
                                        NativeFunction.Natives.SET_VEHICLE_CAN_BE_VISIBLY_DAMAGED(EntryPoint.GetVehicle, false);
                                        NativeFunction.Natives.SET_VEHICLE_TYRES_CAN_BURST(EntryPoint.GetVehicle, false);
                                        NativeFunction.Natives.SET_VEHICLE_WHEELS_CAN_BREAK(EntryPoint.GetVehicle, false);
                                        NativeFunction.Natives.SET_ENTITY_CAN_BE_DAMAGED(EntryPoint.GetVehicle, false);
                                        NativeFunction.Natives.SET_ENTITY_ONLY_DAMAGED_BY_PLAYER(EntryPoint.GetVehicle, false);
                                        NativeFunction.Natives.SET_ENTITY_PROOFS(EntryPoint.GetVehicle, 1, 1, 1, 1, 1, 1, 1, 1);
                                    }
                                    else
                                    {
                                        //   EntryPoint.GetVehicle.IsInvincible = false;
                                    }
                                }
                                catch (Exception e)
                                {
                                    EntryPoint.ErrorLogger(e, "Restore", "Error restoring vehicle parameters");
                                }
                            }
                        }
                    }
                    catch (Exception e) { EntryPoint.ErrorLogger(e, "Restore", "Error restoring vehicle"); }

                    try
                    { ////// RESTORE CHARACTER /////////////////////////////////////////////////////////
                        IEnumerable <XElement> MyPedElements = xdocument.Descendants("MyPedElements");
                        foreach (XElement GetElements in MyPedElements)
                        {
                            //   Game.LocalPlayer.Model = (string)GetElements.Element("MyModel"); // Do not restore as sometimes invisible (MP_M or MP_F)
                            EntryPoint.MyLoc = new Vector3((float)GetElements.Element("MyLocX"),
                                                           (float)GetElements.Element("MyLocY"),
                                                           (float)GetElements.Element("MyLocZ"));
                            World.TeleportLocalPlayer(EntryPoint.MyLoc, false); // Set to true if reports of falling through world
                            Game.LocalPlayer.WantedLevel      = (Int16)GetElements.Element("MyWanted");
                            Game.LocalPlayer.Character.Health = (Int16)GetElements.Element("MyHealth");
                            Game.LocalPlayer.Character.Armor  = (Int16)GetElements.Element("MyArmor");
                            if (((Boolean)GetElements.Element("MyInvincible") == true) || (EntryPoint.PlayerGodMode == true))
                            {
                                NativeFunction.Natives.SetPlayerInvincible(Game.LocalPlayer, true);
                            }
                            else
                            {
                                NativeFunction.Natives.SetPlayerInvincible(Game.LocalPlayer, false);
                            }
                        }

                        if (EntryPoint.InVehicle == true)
                        {
                            Game.LocalPlayer.Character.Tasks.EnterVehicle(EntryPoint.GetVehicle, -1, EnterVehicleFlags.WarpIn).WaitForCompletion();
                            GameFiber.Sleep(2500);

                            if (MyVehRadio != "")
                            {
                                NativeFunction.Natives.SetRadioToStationName(MyVehRadio);
                            }
                            else
                            {
                                NativeFunction.Natives.SetRadioToStationName("OFF");
                            }
                        }
                        else if (EntryPoint.GetVehicle != null)
                        {
                            // Need to get in and out of vehicle to save it again
                            Game.LocalPlayer.Character.Tasks.EnterVehicle(EntryPoint.GetVehicle, -1, EnterVehicleFlags.WarpIn).WaitForCompletion();
                            // Go back to original location
                            Game.LocalPlayer.Character.Tasks.LeaveVehicle(EntryPoint.GetVehicle, LeaveVehicleFlags.WarpOut).WaitForCompletion();
                            World.TeleportLocalPlayer(EntryPoint.MyLoc, false);
                        }
                    }
                    catch (Exception e) { EntryPoint.ErrorLogger(e, "Restore", "Error restoring character"); }

                    try
                    { ////// RESTORE COMPONENTS ////////////////////////////////////////////////////////////
                        IEnumerable <XElement> MyComponentElements = xdocument.Descendants("MyComponentElements");
                        foreach (XElement GetElements in MyComponentElements.Elements())
                        {
                            int GetComponentId = Int16.Parse(GetElements.Attribute("ComponentId").Value);

                            NativeFunction.Natives.SET_PED_COMPONENT_VARIATION(EntryPoint.MyPed,
                                                                               Int16.Parse(GetElements.Attribute("ComponentId").Value),
                                                                               Int16.Parse(GetElements.Attribute("DrawableId").Value),
                                                                               Int16.Parse(GetElements.Attribute("TextureId").Value),
                                                                               Int16.Parse(GetElements.Attribute("PaleteId").Value));
                        }
                    }
                    catch (Exception e) { EntryPoint.ErrorLogger(e, "Restore", "Error restoring character components"); }

                    try
                    { ////// RESTORE PROPS ////////////////////////////////////////////////////////////
                        IEnumerable <XElement> MyPropElements = xdocument.Descendants("MyPropElements");
                        foreach (XElement GetElements in MyPropElements.Elements())
                        {
                            int GetComponentId = Int16.Parse(GetElements.Attribute("ComponentId").Value);

                            NativeFunction.Natives.SET_PED_PROP_INDEX(EntryPoint.MyPed,
                                                                      Int16.Parse(GetElements.Attribute("ComponentId").Value),
                                                                      Int16.Parse(GetElements.Attribute("DrawableId").Value),
                                                                      Int16.Parse(GetElements.Attribute("TextureId").Value),
                                                                      Int16.Parse(GetElements.Attribute("PaleteId").Value));
                        }
                    }
                    catch (Exception e) { EntryPoint.ErrorLogger(e, "Restore", "Error restoring character props"); }

                    try
                    { ////// RESTORE WEAPONS //////////////////////////////////////////////////////////
                        IEnumerable <XElement> MyWeaponElements = xdocument.Descendants("MyWeaponElements");
                        foreach (XElement GetElements in MyWeaponElements.Elements())
                        {
                            Game.LocalPlayer.Character.Inventory.GiveNewWeapon(GetElements.Name.ToString(), short.Parse(GetElements.Value), false);
                        }

                        ////// RESTORE WEAPON COMPONENTS /////////////////////////////////////////////////
                        IEnumerable <XElement> MyWeaponComponents = xdocument.Descendants("MyWeaponComponents");
                        foreach (XElement GetElements in MyWeaponComponents.Elements())
                        {
                            Game.LocalPlayer.Character.Inventory.AddComponentToWeapon(GetElements.Name.ToString(), GetElements.Value);
                        }
                    }
                    catch (Exception e) { EntryPoint.ErrorLogger(e, "Restore", "Error restoring weapons or components"); }

                    try
                    { ////// RESTORE WORLD ////////////////////////////////////////////////////////////
                        NativeFunction.Natives.ClearWeatherTypePersist();
                        IEnumerable <XElement> MyWorldElements = xdocument.Descendants("MyWorldElements");
                        foreach (XElement GetElements in MyWorldElements)
                        {
                            World.TimeOfDay = TimeSpan.Parse((string)GetElements.Element("MyTime"));
                            if (EntryPoint.FreezeTime == true)
                            {
                                NativeFunction.Natives.PauseClock(true);
                            }
                            else
                            {
                                NativeFunction.Natives.PauseClock(false);
                            }
                            if (Lookups.LookupWeather.TryGetValue((Int32)GetElements.Element("MyWeather"), out string Weathresult))
                            {
                                NativeFunction.Natives.SetWeatherTypeNow <string>("Clear");
                                if (EntryPoint.FreezeWeather == true)
                                {
                                    NativeFunction.Natives.SetWeatherTypeNowPersist <string>(Weathresult);
                                }
                                else
                                {
                                    NativeFunction.Natives.SetWeatherTypeNow <string>(Weathresult);
                                }
                            }
                            else
                            {
                                Game.DisplayNotification("Error: RecovFR: Could not recover weather");
                                Game.LogTrivial("RecovFR: Could not detect weather: " + (Int32)GetElements.Element("MyWeather"));
                            }
                            NativeFunction.Natives.SetWindSpeed <float>((float)GetElements.Element("MyWindSpeed"));
                            NativeFunction.Natives.SetWindDirection <float>((float)GetElements.Element("MyWindDirection"));
                            World.WaterPuddlesIntensity = (float)GetElements.Element("MyPuddles");
                            if (EntryPoint.SnowOnGround == true)
                            {
                                MemoryClasses.MemoryAccess.SetSnowRendered(true);
                            }
                            else
                            {
                                MemoryClasses.MemoryAccess.SetSnowRendered(false);
                            }
                        }
                    }
                    catch (Exception e) { EntryPoint.ErrorLogger(e, "Restore", "Error restoring world"); }

                    ////// FINISH UP ////////////////////////////////////////////////////////////
                    EntryPoint.Command_Notification("RecovFR: Restore complete...");
                    GameFiber.Sleep(1000); // Wait 1 second
                    return;
                }
                else
                {
                    // There is no XML file
                    Game.DisplayNotification("~r~~h~RecovFR:~s~~h~ Error: Backup file not found.");
                    Game.LogTrivial("RevovFR: --------------------------------------");
                    Game.LogTrivial("RecovFR: Error during Restore.");
                    Game.LogTrivial("Decription: XML file could not be found.");
                    return;
                }
            } catch (Exception e) { EntryPoint.ErrorLogger(e, "Restore", "Someting went wrong (catch all)"); }
            return;
        }
 private void AddQuestion(List <Question> listQuestions, int i)
 {
     if (listQuestions.ElementAt(i) is Text_Question)
     {
         Text_Question question = (Text_Question)listQuestions.ElementAt(i);
         stackQuestions.Children.Add(GetElements.GetTextQuestion(i + 1 + "- " + question.questionProperty + " ?", false, true));
         (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[0] as Button).Clicked += (sender, e) => {
             question_selected = survey.Questions_Property.ElementAt(i);
             Navigation.PushModalAsync(new TextQuestion(_survey, question_selected, i));
         };
         (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[1] as Button).Clicked += (sender, e) => {
             Delete_Item(i);
         };
     }
     else if (listQuestions.ElementAt(i) is Multible)
     {
         Multible question = (Multible)listQuestions.ElementAt(i);
         if (question.Type.Equals(TypeQuestion.Multible))
         {
             stackQuestions.Children.Add(GetElements.GetMultiChoices(false, i + 1 + "- " + question.title_property + " ?", question.answer, false, true));
             (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[0] as Button).Clicked += (sender, e) =>
             {
                 question_selected = survey.Questions_Property.ElementAt(i);
                 Navigation.PushModalAsync(new MultiChoiceQuestion(_survey, question_selected, i));
             };
             (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[1] as Button).Clicked += (sender, e) => {
                 Delete_Item(i);
             };
         }
         else if (question.Type.Equals(TypeQuestion.MultiChoice))
         {
             stackQuestions.Children.Add(GetElements.GetMultiChoices(true, i + 1 + "- " + question.title_property + " ?", question.answer, false, true));
             (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[0] as Button).Clicked += (sender, e) =>
             {
                 question_selected = survey.Questions_Property.ElementAt(i);
                 Navigation.PushModalAsync(new MultiChoiceQuestion(_survey, question_selected, i));
             };
             (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[1] as Button).Clicked += (sender, e) => {
                 Delete_Item(i);
             };
         }
         else if (question.Type.Equals(TypeQuestion.DropDown))
         {
             stackQuestions.Children.Add(GetElements.GetDropDownQuestion(i + 1 + "- " + question.title_properties + " ?", question.answer.ToList(), false, true));
             (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[0] as Button).Clicked += (sender, e) => {
                 question_selected = survey.Questions_Property.ElementAt(i);
                 Navigation.PushModalAsync(new DropDownQuestion(_survey, question_selected, i));
             };
             (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[1] as Button).Clicked += (sender, e) => {
                 Delete_Item(i);
             };
         }
     }
     else if (listQuestions.ElementAt(i) is Slider_Question)
     {
         Slider_Question question = (Slider_Question)listQuestions.ElementAt(i);
         stackQuestions.Children.Add(
             GetElements.GetSlider(question.Min_Value_Property, question.Max_Value_Property, i + 1 + "- " + question.title_property + " ?", false, true)
             );
         (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[0] as Button).Clicked += (sender, e) => {
             question_selected = survey.Questions_Property.ElementAt(i);
             Navigation.PushModalAsync(new SliderQuestion(_survey, question_selected, i));
         };
         (((stackQuestions.Children[i + 1] as StackLayout).Children[(stackQuestions.Children[i + 1] as StackLayout).Children.Count - 1] as StackLayout).Children[1] as Button).Clicked += (sender, e) => {
             Delete_Item(i);
         };
     }
 }