private void ChargerFichierJson(string file) { var t = new Thread(() => { this.Root = FHXJsonConverter.FromJson(file); //FHXParserWrapper.BuildDeltaVHierarchy(this.Root); this.tvMain.Dispatcher.BeginInvoke(new Action(delegate { this.tvMain.Items.Add(this.Root.ToTreeViewItem(true, false)); })); }); t.Start(); }
private void ConvertJson(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "FHX file (*.fhx)|*.fhx"; if (openFileDialog.ShowDialog() == true) { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "JSON file (*.json)|*.json"; if (saveFileDialog.ShowDialog() == true) { var t = new Thread(() => { FHXObject o = FHXParserWrapper.FromFile(openFileDialog.FileName); FHXParserWrapper.BuildDeltaVHierarchy(o); FHXJsonConverter.ToJson(o, saveFileDialog.FileName); MessageBox.Show("Fichier converti"); }); t.Start(); } } }