static void create() { Console.WriteLine("Creating..."); var baseDir = new FSODirectory(sourcePath, FSOType.RootDirectory) { Info = info }; var subObjs = baseDir.trawlRecursively(new NominalRTM(prompt, sourcePath), false); baseDir.update(); var objs = new List <FSOBase>(); objs.Add(baseDir); objs.AddRange(subObjs); side1 = new Integrator(integratorTypes, 1, objs.Count); for (int i = 0; i < objs.Count; i++) { side1.set_block(0, i, objs[i].createElements()); } if (serializeIntegration) { var sav = new BinaryLoaderSaver(); side1.save(sav); File.WriteAllBytes(integrationFile, sav.data); } else { var sav = new XMLLoaderSaver(); side1.save(sav); File.WriteAllText(integrationFile, sav.data); } }
static void update() { Console.WriteLine("Updating..."); if (serializeIntegration) { var sav = new BinaryLoaderSaver(); side2.save(sav); File.WriteAllBytes(integrationFile, sav.data); } else { var sav = new XMLLoaderSaver(); side2.save(sav); File.WriteAllText(integrationFile, sav.data); } }
static void load() { Console.WriteLine("Loading..."); if (serializeIntegration) { var dat = File.ReadAllBytes(integrationFile); var lod = new BinaryLoaderSaver(dat); side1 = new Integrator(integratorTypes, 0, 0); side1.load(lod); } else { var dat = File.ReadAllText(integrationFile); var lod = new XMLLoaderSaver(dat); side1 = new Integrator(integratorTypes, 0, 0); side1.load(lod); } }