ModelApplicationBase GetMasterModelCore(bool recreate) { InterfaceBuilder.SkipAssemblyCleanup = true; var masterModel = !recreate ? _modelLoader.GetMasterModel(true) : _modelLoader.ReCreate(); InterfaceBuilder.SkipAssemblyCleanup = false; return masterModel; }
void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs) { if (objectChangeEventArgs.PropertyName == "XmlContent") { var aspect = _masterModel.CurrentAspect; _masterModel = _modelLoader.GetMasterModel(false); CreateModelEditorController(aspect); } }
public static void AddKnownTypes(string modulePath) { InterfaceBuilder.SkipAssemblyCleanup = true; var instance = XafTypesInfo.Instance; var modelLoader = new ModelLoader(modulePath, instance); modulePath = Path.GetFullPath(modulePath); var typesInfo = TypesInfoBuilder.Create().FromModule(modulePath).Build(false); var xafApplication = ApplicationBuilder.Create() .UsingTypesInfo(s => typesInfo) .FromModule(modulePath) .FromAssembliesPath(Path.GetDirectoryName(modulePath)) .WithOutObjectSpaceProvider() .Build(); modelLoader.GetMasterModel(xafApplication); AddKnownTypesForAll(typesInfo); instance.AssignAsInstance(); xafApplication.Dispose(); InterfaceBuilder.SkipAssemblyCleanup = true; }
protected override void OnCurrentObjectChanged() { _modelLoader = new ModelLoader(CurrentObject.PersistentApplication.ExecutableName); _masterModel = _modelLoader.GetMasterModel(false); base.OnCurrentObjectChanged(); }