public void RequestEdit(ModelicaModel context) { if (context != null) { if (File.Exists(context.Path)) { context.SourceCode = File.ReadAllText(context.Path); } _eventAggregator.PublishOnUIThreadAsync(new RequestModelEditorMessage() { Owner = context }); } }
void Explore(Entity node) { var subdirs = Directory.EnumerateDirectories(node.Path); foreach (var subdir in subdirs) { var di = new DirectoryInfo(subdir); var child = new Folder() { Name = di.Name, Path = subdir }; Explore(child); node.Children.Add(child); } var models = Directory.EnumerateFiles(node.Path, "*.mo"); foreach (var model in models) { var child = new ModelicaModel(Path.GetFileName(model), model); node.Children.Add(child); } }