• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ModelApplicationBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ModelApplicationBase的典型用法代码示例。如果您正苦于以下问题:C# ModelApplicationBase类的具体用法?C# ModelApplicationBase怎么用?C# ModelApplicationBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ModelApplicationBase类属于命名空间,在下文中一共展示了ModelApplicationBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetAllLayers

 protected IEnumerable<ModelApplicationBase> GetAllLayers(IEnumerable<ModelDifferenceObject> differenceObjects, ModelApplicationBase master) {
     if (GetttingNonAppModels(differenceObjects))
         differenceObjects = differenceObjects.Where(o => o.CombineOrder < CombineOrder);
     var modelApplicationBases = differenceObjects.Distinct().Select(differenceObject => differenceObject.GetModel(master));
     modelApplicationBases = modelApplicationBases.Concat(new List<ModelApplicationBase> { GetModel(master) });
     return modelApplicationBases;
 }
开发者ID:gvilas,项目名称:eXpand,代码行数:7,代码来源:ModelDifferenceObject.cs


示例2: ReplaceLayer

        protected override void ReplaceLayer(ModelApplicationBase model, ModelApplicationBase layer, bool isCurrentUserModel, ShowViewParameters showViewParameters){
            
            var showViewStrategyBase = (WinShowViewStrategyBase)Application.ShowViewStrategy;
            var modelApplicationBase = ((ModelApplicationBase)Application.Model);
            var lastLayer = modelApplicationBase.LastLayer;
            modelApplicationBase.RemoveLayer(lastLayer.Id);

            var dummyLayer = modelApplicationBase.CreatorInstance.CreateModelApplication();
            dummyLayer.Id = lastLayer.Id;
            ModelApplicationHelper.AddLayer(modelApplicationBase, dummyLayer);
            var keyValue = ObjectSpace.GetKeyValue(View.CurrentObject);
            var objectType = View.ObjectTypeInfo.Type;
            var modelDetailView = View.Model;
            showViewStrategyBase.CloseAllWindows();

            base.ReplaceLayer(model, layer, isCurrentUserModel,showViewParameters);
            showViewStrategyBase.ShowStartupWindow();

            var xafApplication = ApplicationHelper.Instance.Application;
            var objectSpace = xafApplication.CreateObjectSpace();
            var objectByKey = objectSpace.GetObjectByKey(objectType,keyValue);
            showViewStrategyBase = (WinShowViewStrategyBase)xafApplication.ShowViewStrategy;
            
            showViewParameters.CreatedView = xafApplication.CreateDetailView(objectSpace, modelDetailView, true, objectByKey);
            showViewStrategyBase.ShowView(showViewParameters, new ShowViewSource(null,null));

        }
开发者ID:aries544,项目名称:eXpand,代码行数:27,代码来源:ReloadApplicationModelController.cs


示例3: AddLayers

 void AddLayers(ModelApplicationBase modelApplication, ApplicationModulesManager applicationModulesManager, PathInfo pathInfo) {
     var resourceModelCollector = new ResourceModelCollector();
     var dictionary = resourceModelCollector.Collect(applicationModulesManager.Modules.Select(@base => @base.GetType().Assembly), null);
     AddLayersCore(dictionary.Where(pair => !PredicateLastLayer(pair, pathInfo)), modelApplication);
     ModelApplicationBase lastLayer = modelApplication.CreatorInstance.CreateModelApplication();
     modelApplication.AddLayer(lastLayer);
 }
开发者ID:krazana,项目名称:eXpand,代码行数:7,代码来源:ModelControllerBuilder.cs


示例4: AddLayerBeforeLast

 public static void AddLayerBeforeLast(this ModelApplicationBase application, ModelApplicationBase layer) {
     ModelApplicationBase lastLayer = application.LastLayer;
     if (lastLayer.Id != "After Setup" && lastLayer.Id != "UserDiff")
         throw new ArgumentException("LastLayer.Id", lastLayer.Id);
     ModelApplicationHelper.RemoveLayer(application);
     ModelApplicationHelper.AddLayer(application, layer);
     ModelApplicationHelper.AddLayer(application, lastLayer);
 }
开发者ID:dimajanzen,项目名称:eXpand,代码行数:8,代码来源:ModelExtensions.cs


示例5: OnDifferenceObjectSaving

 protected internal override void OnDifferenceObjectSaving(ModelDifferenceObject userModelDifferenceObject, ModelApplicationBase model) {
     var userStoreObject = ((UserModelDifferenceObject)userModelDifferenceObject);
     if (!userStoreObject.NonPersistent) {
         userModelDifferenceObject.CreateAspectsCore(model);
         base.OnDifferenceObjectSaving(userModelDifferenceObject, model);
     }
     CombineModelFromPermission(model);
 }
开发者ID:noxe,项目名称:eXpand,代码行数:8,代码来源:XpoUserModelDictionaryDifferenceStore.cs


示例6: RemoveLayers

 IEnumerable<ModelApplicationBase> RemoveLayers(ModelApplicationBase modelApplicationBase, IEnumerable<string> strings) {
     var modelApplicationBases = new List<ModelApplicationBase>();
     while (modelApplicationBase.LastLayer.Id != "Unchanged Master Part") {
         if (!(strings.Contains(modelApplicationBase.LastLayer.Id)))
             modelApplicationBases.Add(modelApplicationBase.LastLayer);
         ModelApplicationHelper.RemoveLayer(modelApplicationBase.LastLayer);
     }
     return modelApplicationBases;
 }
开发者ID:jdraith1,项目名称:eXpand,代码行数:9,代码来源:ModelApplicationLoader.cs


示例7: GetLoadedModelDifferenceObjectInfos

 Dictionary<string, ModelDifferenceObjectInfo> GetLoadedModelDifferenceObjectInfos(ModelApplicationBase model) {
     Dictionary<string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos = GetLoadedModelApplications(model);
     if (!loadedModelDifferenceObjectInfos.Any())
         if (ObjectSpace.IsServerSide() || !(Application is ServerApplication))
             return CreateNew(model);
         else
             return loadedModelDifferenceObjectInfos;
     return loadedModelDifferenceObjectInfos;
 }
开发者ID:kamchung322,项目名称:eXpand,代码行数:9,代码来源:XpoModelDictionaryDifferenceStore.cs


示例8: ReadFromModel

 public static void ReadFromModel(this ModelXmlReader modelXmlReader, ModelApplicationBase modelNode,
                                   ModelApplicationBase readFrom, Func<string, bool> aspectNamePredicate) {
     for (int i = 0; i < readFrom.AspectCount; i++) {
         string aspect = readFrom.GetAspect(i);
         string xml = new ModelXmlWriter().WriteToString(readFrom, i);
         if (!(string.IsNullOrEmpty(xml)))
             new ModelXmlReader().ReadFromString(modelNode, aspect, xml);
     }
 }
开发者ID:paulute,项目名称:eXpand,代码行数:9,代码来源:ModelXmlReaderExtensions.cs


示例9: LoadApplicationModels

 void LoadApplicationModels(bool loadResources, ModelApplicationBase model) {
     var userDiffLayer = model.LastLayer;
     ModelApplicationHelper.RemoveLayer(model);
     var customModelDifferenceStoreEventArgs = new CreateCustomModelDifferenceStoreEventArgs();
     OnCreateCustomModelDifferenceStore(customModelDifferenceStoreEventArgs);
     if (!customModelDifferenceStoreEventArgs.Handled)
         new XpoModelDictionaryDifferenceStore(Application, GetPath(), customModelDifferenceStoreEventArgs.ExtraDiffStores, loadResources).Load(model);
     ModelApplicationHelper.AddLayer((ModelApplicationBase)Application.Model, userDiffLayer);
     RuntimeMemberBuilder.CreateRuntimeMembers(Application.Model);
 }
开发者ID:kamchung322,项目名称:eXpand,代码行数:10,代码来源:ModelDifferenceBaseModule.cs


示例10: CombineWithActiveDifferenceObjects

 void CombineWithActiveDifferenceObjects(ModelApplicationBase model, IEnumerable<ModelDifferenceObject> modelDifferenceObjects) {
     var reader = new ModelXmlReader();
     foreach (var modelDifferenceObject in modelDifferenceObjects) {
         foreach (var aspectObject in modelDifferenceObject.AspectObjects) {
             var xml = aspectObject.Xml;
             if (!string.IsNullOrEmpty(xml))
                 reader.ReadFromString(model, modelDifferenceObject.GetAspectName(aspectObject), xml);
         }
     }
 }
开发者ID:noxe,项目名称:eXpand,代码行数:10,代码来源:XpoUserModelDictionaryDifferenceStore.cs


示例11: SaveDifference

        public override void SaveDifference(ModelApplicationBase model) {
            if (model != null) {
                _objectSpace = _application.CreateObjectSpace() as ObjectSpace;
                ModelDifferenceObject modelDifferenceObject =
                    GetActiveDifferenceObject(model.Id) ??
                    GetNewDifferenceObject(_objectSpace)
                    .InitializeMembers(model.Id == "Application" ? Application.Title : model.Id, Application.Title, Application.GetType().FullName);

                OnDifferenceObjectSaving(modelDifferenceObject, model);
            }
        }
开发者ID:krazana,项目名称:eXpand,代码行数:11,代码来源:XpoDictionaryDifferenceStore.cs


示例12: Load

        public override void Load(ModelApplicationBase model) {
            base.Load(model);

            var modelDifferenceObjects = GetActiveDifferenceObjects().ToList();
            if (modelDifferenceObjects.Count() == 0) {
                SaveDifference(model);
                return;
            }

            CombineWithActiveDifferenceObjects(model, modelDifferenceObjects);
        }
开发者ID:gvilas,项目名称:eXpand,代码行数:11,代码来源:XpoUserModelDictionaryDifferenceStore.cs


示例13: AddLayers

 public void AddLayers(string modelApplicationPrefix, Dictionary<string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos, ModelApplicationBase model) {
     var modelXmlReader = new ModelXmlReader();
     var assemblies = _xafApplication.Modules.Select(module => module.GetType().Assembly);
     var resourceModelCollector = new ResourceModelCollector();
     foreach (var keyValuePair in resourceModelCollector.Collect(assemblies, modelApplicationPrefix)) {
         var modelDifferenceObjectInfo = GetModelDifferenceObjectInfo(modelApplicationPrefix, loadedModelDifferenceObjectInfos, keyValuePair.Key, model);
         foreach (var aspectInfo in keyValuePair.Value.AspectInfos) {
             modelXmlReader.ReadFromString(modelDifferenceObjectInfo.Model, aspectInfo.AspectName, aspectInfo.Xml);
         }
         modelDifferenceObjectInfo.ModelDifferenceObject.CreateAspects(modelDifferenceObjectInfo.Model);
     }
 }
开发者ID:aries544,项目名称:eXpand,代码行数:12,代码来源:ResourcesLayerBuilder.cs


示例14: AddLayersCore

 void AddLayersCore(IEnumerable<KeyValuePair<string, ResourceInfo>> layers, ModelApplicationBase modelApplication) {
     IEnumerable<KeyValuePair<string, ResourceInfo>> keyValuePairs = layers;
     foreach (var pair in keyValuePairs) {
         ModelApplicationBase layer = modelApplication.CreatorInstance.CreateModelApplication();
         layer.Id = pair.Key;
         modelApplication.AddLayer(layer);
         var modelXmlReader = new ModelXmlReader();
         foreach (var aspectInfo in pair.Value.AspectInfos) {
             modelXmlReader.ReadFromString(layer, aspectInfo.AspectName, aspectInfo.Xml);
         }
     }
 }
开发者ID:krazana,项目名称:eXpand,代码行数:12,代码来源:ModelControllerBuilder.cs


示例15: CombineModelFromPermission

 void CombineModelFromPermission(ModelApplicationBase model) {
     if (SecuritySystem.Instance is ISecurityComplex && IsGranted()) {
         var space = Application.CreateObjectSpace();
         ModelDifferenceObject difference = GetDifferenceFromPermission((XPObjectSpace)space);
         var master = new ModelLoader(difference.PersistentApplication.ExecutableName).GetMasterModel(true);
         var diffsModel = difference.GetModel(master);
         new ModelXmlReader().ReadFromModel(diffsModel, model);
         difference.CreateAspectsCore(diffsModel);
         space.SetModified(difference);
         space.CommitChanges();
     }
 }
开发者ID:jdraith1,项目名称:eXpand,代码行数:12,代码来源:XpoUserModelDictionaryDifferenceStore.cs


示例16: GetModelDifferenceObjectInfo

 ModelDifferenceObjectInfo GetModelDifferenceObjectInfo(string prefix, Dictionary<string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos, string resourceName, ModelApplicationBase model) {
     ModelDifferenceObject activeDifferenceObject;
     ModelApplicationBase modelApplicationBase;
     if (!loadedModelDifferenceObjectInfos.ContainsKey(resourceName)) {
         activeDifferenceObject = FindDifferenceObject(resourceName, prefix) ??
                                  CreateDifferenceObject(resourceName, prefix);
         modelApplicationBase = activeDifferenceObject.GetModel(model);
     } else {
         var loadedModelDifferenceObjectInfo = loadedModelDifferenceObjectInfos[resourceName];
         activeDifferenceObject = loadedModelDifferenceObjectInfo.ModelDifferenceObject;
         modelApplicationBase = loadedModelDifferenceObjectInfo.Model;
     }
     return new ModelDifferenceObjectInfo(activeDifferenceObject, modelApplicationBase);
 }
开发者ID:aries544,项目名称:eXpand,代码行数:14,代码来源:ResourcesLayerBuilder.cs


示例17: Load

        public override void Load(ModelApplicationBase model) {
            base.Load(model);

            foreach (var roleModel in this.GetActiveRoleDifferenceObjects())
                roleModel.GetModel(base.Application.Model as ModelApplicationBase);

            var modelDifferenceObjects = GetActiveDifferenceObjects().ToList();
            if (modelDifferenceObjects.Count() == 0) {
                SaveDifference(model);
                return;
            }

            CombineWithActiveDifferenceObjects(model, modelDifferenceObjects);
        }
开发者ID:testexpand,项目名称:eXpand,代码行数:14,代码来源:XpoUserModelDictionaryDifferenceStore.cs


示例18: GetLoadedModelDifferenceObjectInfos

        Dictionary<string, ModelDifferenceObjectInfo> GetLoadedModelDifferenceObjectInfos(ModelApplicationBase model) {
            Dictionary<string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos = GetLoadedModelApplications(model);

            if (loadedModelDifferenceObjectInfos.Count() == 0) {
                var modelDifferenceObjectInfos = new Dictionary<string, ModelDifferenceObjectInfo>();
                var application = model.CreatorInstance.CreateModelApplication();
                application.Id = XpandModuleBase.Application.Title;
                model.AddLayerBeforeLast(application);
                var modelDifferenceObject = ObjectSpace.CreateObject<ModelDifferenceObject>().InitializeMembers(application.Id);
                modelDifferenceObjectInfos.Add(application.Id, new ModelDifferenceObjectInfo(modelDifferenceObject, application));
                loadedModelDifferenceObjectInfos = modelDifferenceObjectInfos;
            }
            return loadedModelDifferenceObjectInfos;
        }
开发者ID:gvilas,项目名称:eXpand,代码行数:14,代码来源:XpoModelDictionaryDifferenceStore.cs


示例19: Load

 public override void Load(ModelApplicationBase model) {
     var extraDiffStoresLayerBuilder = new ExtraDiffStoresLayerBuilder();
     var language = model.Application.PreferredLanguage;
     if (UseModelFromPath()) {
         return;
     }
     var loadedModelDifferenceObjectInfos = GetLoadedModelDifferenceObjectInfos(model);
     extraDiffStoresLayerBuilder.AddLayers(loadedModelDifferenceObjectInfos, _extraDiffStores);
     if (_loadResources)
         CreateResourceModels(model, loadedModelDifferenceObjectInfos);
     if (model.Application.PreferredLanguage != language) {
         Application.SetLanguage(model.Application.PreferredLanguage);
     }
     ObjectSpace.CommitChanges();
 }
开发者ID:gvilas,项目名称:eXpand,代码行数:15,代码来源:XpoModelDictionaryDifferenceStore.cs


示例20: CombineModelFromPermission

 void CombineModelFromPermission(ModelApplicationBase model) {
     if (SecuritySystem.Instance is ISecurityComplex && IsGranted()) {
         var space = Application.CreateObjectSpace(typeof(ModelDifferenceObject));
         ModelDifferenceObject difference = GetDifferenceFromPermission((XPObjectSpace)space);
         if (difference != null) {
             InterfaceBuilder.SkipAssemblyCleanup = true;
             var master = new ModelLoader(difference.PersistentApplication.ExecutableName, XafTypesInfo.Instance).GetMasterModel(true,info => info.AssignAsInstance());
             InterfaceBuilder.SkipAssemblyCleanup = false;
             var diffsModel = difference.GetModel(master);
             new ModelXmlReader().ReadFromModel(diffsModel, model);
             difference.CreateAspectsCore(diffsModel);
             space.SetModified(difference);
             space.CommitChanges();
         }
     }
 }
开发者ID:noxe,项目名称:eXpand,代码行数:16,代码来源:XpoUserModelDictionaryDifferenceStore.cs



注:本文中的ModelApplicationBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ModelBase类代码示例发布时间:2022-05-24
下一篇:
C# Model类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap