private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            Owner.Visibility = Visibility.Visible;

            //Clearing saved session if all answered start
            if (questionNumber >= 8)
            {
                _askedQuestionAnswer.Clear();
            }
            //Clearing saved session if all answered end

            // Storing Answered Question and Answer Start
            if (MainWindow.language == "en")
            {
                MyStorage.WriteXml <ObservableCollection <QuestionAnswer> >(Questionare._askedQuestionAnswer, "QandA.xml");
            }
            if (MainWindow.language == "de")
            {
                MyStorage.WriteXml <ObservableCollection <QuestionAnswer> >(Questionare._askedQuestionAnswer, "QandA.de.xml");
            }
            // Storing Answered Question and Answer End

            //Clearing the Results List Start
            App.Colleges.Clear();
            App.Jobs.Clear();
            App.Details.Clear();
            //Clearing the Results List End
        }
        //Declaring  Obsevable collection to store selected questions and answers end


        public Questionare()
        {
            InitializeComponent();

            // Loading Previously Stored Question and Answer Start
            if (MainWindow.language == "en")
            {
                Questionare._askedQuestionAnswer = MyStorage.ReadXML <ObservableCollection <QuestionAnswer> >("QandA.xml");
            }
            if (MainWindow.language == "de")
            {
                Questionare._askedQuestionAnswer = MyStorage.ReadXML <ObservableCollection <QuestionAnswer> >("QandA.de.xml");
            }
            // Loading Previously Stored Question and Answer End

            // Loading Question Start
            if (MainWindow.language == "en")
            {
                doc.Load("Questions.xml");
            }
            if (MainWindow.language == "de")
            {
                doc.Load("Questions.de.xml");
            }
            // Loading Question End

            //Text for start or Continue start
            if (_askedQuestionAnswer.Count != 0)
            {
                if (MainWindow.language == "en")
                {
                    Txt_PressStart.Margin = new System.Windows.Thickness(-45, 0, 0, 0);
                    Txt_PressStart.Text   = "Press Continue To Resume Your Sessions ";
                }
                else if (MainWindow.language == "de")
                {
                    Txt_PressStart.Margin = new System.Windows.Thickness(-5, 0, 0, 0);
                    Txt_PressStart.Text   = "Weiter drücken, um fortzufahren";
                }
                Btn_Continue.Visibility = Visibility.Visible;
            }
            else
            {
                if (MainWindow.language == "en")
                {
                    Txt_PressStart.Margin = new System.Windows.Thickness(15, 5, 0, 0);
                    Txt_PressStart.Text   = "Press New To Find Your Career";
                }
                else if (MainWindow.language == "de")
                {
                    Txt_PressStart.Text = "Presse Neu, um Ihre Karriere zu finden";
                }
            }
            //Text for start or Continue end
        }
示例#3
0
        //Declaring List for Colleges,Jobs and Details end


        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //loading the courses from the file start
            _courses = MyStorage.ReadXML <ObservableCollection <Course> >("Courses.xml");

            //Questionare._askedQuestionAnswer = MyStorage.ReadXML<ObservableCollection<QuestionAnswer>>("QandA.xml");

            if (_courses == null)
            {
                _courses = new ObservableCollection <Course>();
            }
            if (Questionare._askedQuestionAnswer == null)
            {
                Questionare._askedQuestionAnswer = new ObservableCollection <QuestionAnswer>();
            }
            //loading the courses from the file end
        }