Beispiel #1
0
        private CatrobatContext()
        {
            bool firstTimeUse = !RestoreLocalSettings();

              if (Debugger.IsAttached)
              {
            var loader = new SampleProjectLoader();
            loader.LoadSampleProjects();
            UpdateLocalProjects();
              }

              if (firstTimeUse)
              {
            RestoreDefaultProject(DefaultProjectName);
            LocalSettings = new LocalSettings();
            LocalSettings.CurrentProjectName = CurrentProject.ProjectName;
              }
              else
              {
            InitializeLocalSettings();
              }
        }
        public void ReadWriteSerializableObjectTest()
        {
            TestHelper.InitializeAndClearCatrobatContext();

              using (var storage = StorageSystem.GetStorage())
              {
            LocalSettings settingsWrite = new LocalSettings();
            settingsWrite.CurrentProjectName = "ProjectName";

            storage.WriteSerializableObject("testobject", settingsWrite);
            LocalSettings settingsRead = (LocalSettings)storage.ReadSerializableObject("testobject", settingsWrite.GetType());

            Assert.AreEqual(settingsRead.CurrentProjectName, "ProjectName");
              }
        }