private void Load() { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.DefaultExt = ".cexml"; dlg.Filter = "CleanEstimate Datei |*.cexml"; bool? result = dlg.ShowDialog(); if (result.HasValue && result.Value) { using (FileStream fs = new FileStream(dlg.FileName, FileMode.Open, FileAccess.Read)) { try { IsEdited = false; Daten.Firma tempFirma = new Daten.Firma(); tempFirma.Load(fs); Firma = new FirmaObservableObject(tempFirma); Frame = new View.ObjektView(); FilePath = dlg.FileName; } catch (Exception) { MessageBox.Show("Die CleanEstimate Datei ist fehlerhaft.", "Fehler CleanEstimate Datei!", MessageBoxButton.OK, MessageBoxImage.Error); } } } }
public ObjektObservableObject(Daten.Settings settings, FirmaObservableObject firma) { _Settings = settings; _Firma = firma; }