public void Open(string filename) { XmlConfigFile existingModel = this.Model; UnitTestFileViewModel existingUTModel = this.UnitTestFile; try { ActiveConfig.DB.CanCache = true; AcmaSchemaAttribute.MissingAttributeEvent += AcmaSchemaAttribute_MissingAttributeEvent; UINotifyPropertyChanges.BeginIgnoreAllChanges(); this.Model = ActiveConfig.LoadXml(filename); this.unitTestFile = TestEngine.UnitTestFile.LoadXml(this.FileName); this.ReloadRootNodes(); this.ResetChangeState(); } catch { this.Model = existingModel; this.UnitTestFile = existingUTModel; throw; } finally { UINotifyPropertyChanges.EndIgnoreAllChanges(); this.RaisePropertyChanged("DisplayName"); this.RaisePropertyChanged("ChildNodes"); AcmaSchemaAttribute.ClearLostFoundCache(); AcmaSchemaAttribute.MissingAttributeEvent -= AcmaSchemaAttribute_MissingAttributeEvent; ActiveConfig.DB.CanCache = false; } }