예제 #1
0
 private void loadConfig()
 {
     myConfig = CFSConfig.Load(null);
     if (myConfig == null)
     {
         myConfig = new CFSConfig();
     }
     myDrives = new DriveConfigBindingList();
     myDrives.AddAll(myConfig.Drives);
     this.dgConfigs.DataSource = myDrives;
     currentFiles = new FileChoiceBindingList();
     if (myDrives.Count > 0)
     {
         currentFiles.SwitchTo(myDrives[0]);
     }
     this.dgFiles.DataSource = currentFiles;
 }
예제 #2
0
        public void SaveLoadTest()
        {
            CFSConfig target = new CFSConfig();

            target.add(makeConfig("test1"));
            target.add(makeConfig("test2"));
            string optionalName = "testCfg.config";
            bool   expected     = true;
            bool   actual;

            actual = target.Save(optionalName);
            Assert.AreEqual(expected, actual);

            CFSConfig loaded;

            loaded = CFSConfig.Load(optionalName);
            Assert.AreEqual(target.Drives.Count, loaded.Drives.Count);
        }