Example #1
0
 public void Init()
 {
     // Start with a clean Model and database.
     TestModel = new ModelXml();
     if (System.IO.File.Exists(DefaultFilename))
     {
         System.IO.File.Delete(DefaultFilename);
     }
     TestModel.CreateDatabase(DefaultFilename);
 }
        public SplitsViewModel(IUserSettings Settings, IHomunculusModel Model)
        {
            // If the caller is not supplying a user settings
            // interface object, just make our own.
            if (Settings == null)
            {
                UserSettings = new StandardUserSettings();
            }
            else
            {
                UserSettings = Settings;
            }

            // If the caller is not supplying a model object,
            // just make our own.
            if (Model == null)
            {
                Challenges = new ModelXml();
                if (System.IO.File.Exists("homunculus.xml"))
                {
                    Challenges.LoadDatabase("homunculus.xml");
                }
                else
                {
                    Challenges.CreateDatabase("homunculus.xml");
                }
            }
            else
            {
                Challenges = Model;
            }

            // Get the challenges and set one to current, if available.
            challengeList    = Challenges.GetChallenges();
            CurrentChallenge = (string)UserSettings.GetUserSetting("LastUsedChallenge");

            SuccessButtonText = "Success";
        }
Example #3
0
 public void CreateDatabase_NullFilename()
 {
     TestModel.CreateDatabase(null);
 }