Пример #1
0
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();
            //Load Profils
            ProfilProperties profile = new ProfilProperties();

            for (int i = 1; i <= 5; i++)
            {
                profile = ProfilProperties.Load("Profils\\Profil" + i + ".xml");
                ProfilXml.Add(profile);
            }

            //Is there an active Profil at beginning
            int test = 0;

            foreach (ProfilProperties i in ProfilXml)
            {
                if (i.Active == true)
                {
                    test += 1;
                    if (test == 1)
                    {
                        CurrentNumber = i.ProfilNummer;
                    }
                }
            }
            if (test == 0)
            {
                CurrentNumber = 1;
                Menü          = true;
            }
            CurrentProfil = ProfilXml[CurrentNumber - 1];

            //StartButton if there is an active Profil
            if (CurrentProfil.Active == true)
            {
                while (!CurrentButton.getButtonName().Equals("Ok"))
                {
                    CurrentList.Next();
                }
            }
        }