コード例 #1
0
 ModelApplicationBase GetMasterModelCore(bool recreate)
 {
     InterfaceBuilder.SkipAssemblyCleanup = true;
     var masterModel = !recreate ? _modelLoader.GetMasterModel(true) : _modelLoader.ReCreate();
     InterfaceBuilder.SkipAssemblyCleanup = false;
     return masterModel;
 }
コード例 #2
0
 void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs)
 {
     if (objectChangeEventArgs.PropertyName == "XmlContent")
     {
         var aspect = _masterModel.CurrentAspect;
         _masterModel = _modelLoader.GetMasterModel(false);
         CreateModelEditorController(aspect);
     }
 }
コード例 #3
0
        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;
        }
コード例 #4
0
 protected override void OnCurrentObjectChanged()
 {
     _modelLoader = new ModelLoader(CurrentObject.PersistentApplication.ExecutableName);
     _masterModel = _modelLoader.GetMasterModel(false);
     base.OnCurrentObjectChanged();
 }