public void Initialize(string projectName, string projectDir, ModelCreationMode modelMode, string model) { ThreadPool.QueueUserWorkItem(o => { OnInitialization(); Guid id = Guid.NewGuid(); this.projectDir = projectDir; Project = new Project(projectName, id); Project.Save(projectDir); SaveProjectToSettings(); tree = new ExperimentsTree(TreeFileName, id); bool pack = false; switch (modelMode) { case ModelCreationMode.cmCreateNew: pack = DirectoryPacker.Pack(ModelDir, SnapshotDataFileName, id); CreateModel(model); break; case ModelCreationMode.cmClone: pack = DirectoryPacker.Pack(model, SnapshotDataFileName, id); if (pack) { DirectoryPacker.UnPack(ModelDir, SnapshotDataFileName, id); } LoadModel(); break; } Experiment.Create(id, ExperimentFileName, MakeBackup(id), pack); OnInitialized(); }); }
public void Initialize(string projectName, string projectDir, ModelCreationMode modelMode, string model) { ThreadPool.QueueUserWorkItem(o => { OnInitialization(); Guid id = Guid.NewGuid(); this.projectDir = projectDir; Project = new Project(projectName, id); Project.Save(projectDir); SaveProjectToSettings(); tree = new ExperimentsTree(TreeFileName, id); bool pack = false; switch (modelMode) { case ModelCreationMode.cmCreateNew: pack = DirectoryPacker.Pack(ModelDir, SnapshotDataFileName, id); CreateModel(model); break; case ModelCreationMode.cmClone: pack = DirectoryPacker.Pack(model, SnapshotDataFileName, id); if (pack) DirectoryPacker.UnPack(ModelDir, SnapshotDataFileName, id); LoadModel(); break; } Experiment.Create(id, ExperimentFileName, MakeBackup(id), pack); OnInitialized(); }); }