private void LoadModelCommandExecute(object obj) { var dialog = new OpenFileDialog() { DefaultExt = ".xml", Filter = "XML Files (.xml)|*.xml" }; if (dialog.ShowDialog() != true) { return; } var parser = new ProcessKindXmlParser(); var xml = File.ReadAllText(dialog.FileName); ProcessKind = parser.ParseDefinition(xml); ProcessKind.ActorRoles.ForEach(x => ActorRoles.Add(x)); // = result; //result.ActorRoles.ForEach(x => ActorRoles.Add(x)); }
public async Task Start() { if (timer == null) { timer = new Timer(NotifySimulationNextStep); } // var caseParser = new SimulationCaseParser(); var parser = new ProcessKindXmlParser(); var xml = await SimulationCases.LoadXmlAsync(SimulationCases.ModelDefinition); processKind = parser.ParseDefinition(xml); var caseXml = await SimulationCases.LoadXmlAsync(SimulationCases.Case01); simulation = new RentalContractSimulationFromXml(caseXml); simulation.Prepare(); //send model definition await Hub.Clients.All.NotifyStart(processKind); timer.Change(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1)); }