Reuse Implemented Functionality 重用实现功能
A default XAF solution contains one platform-agnostic (shared) module and platform-dependent modules for each application. This topic describes how to add extra modules and business objects from an external library to the shared module to extend the applications' functionality.
默认的XAF解决方案为每个应用程序包含一个平台无关的(共享的)模块和平台相关的模块。本主题描述如何将外部库中的额外模块和业务对象添加到共享模块以扩展应用程序的功能。
XAF Extra Modules
XAF额外的模块
Use the Module Designer or Application Designer to add or remove extra modules. Double-click the Module.cs (Module.vb) file to invoke the Module Designer from a module project. To invoke the Application Designer, double-click the WinApplication.cs (WinApplication.vb) or WebApplication.cs (WebApplication.vb) file in an application project.
使用模块设计器或应用程序设计器添加或删除额外的模块。双击Module.cs (Module.vb)文件,从模块项目调用模块设计器。要调用应用程序设计器,双击应用程序项目中的WinApplication.cs (WinApplication.vb)或WebApplication.cs (WebApplication.vb)文件。
Follow the steps below to add the Conditional Appearance and Validation module to the shared module and set up how they interact with the business objects.
按照以下步骤将条件外观和验证模块添加到共享模块,并设置它们与业务对象的交互方式。
- Invoke the Module Designer for the shared module in the SimpleProjectManager.Module project.
Drag the Conditional Appearance and Validation modules from the Toolbox to the designer's Required Modules section.
为SimpleProjectManager中的共享模块调用模块设计器。模块项目。
.将“条件外观”和“验证”模块从“工具箱”拖动到“设计器所需的模块”部分。

Open the SimpleProjectManager.Module\BusinessObjects\Planning.cs(vb) file. Apply the AppearanceAttribute and RuleCriteriaAttribute to the ProjectTask class, as demonstrated below:
打开SimpleProjectManager.Module\BusinessObjects\ plan .cs(vb)文件。将外观属性和RuleCriteriaAttribute应用到ProjectTask类,如下所示:
using DevExpress.ExpressApp.ConditionalAppearance;
using DevExpress.Persistent.Validation;
using System.Drawing;
// ...
[Appearance("Completed1", TargetItems = "Subject",
Criteria = "Status = 'Completed'", FontStyle = FontStyle.Strikeout, FontColor = "ForestGreen")]
[Appearance("Completed2", TargetItems = "*;Status;AssignedTo",
Criteria = "Status = 'Completed'", Enabled = false)]
[Appearance("InProgress", TargetItems = "Subject;AssignedTo",
Criteria = "Status = 'InProgress'", BackColor = "LemonChiffon")]
[Appearance("Deferred", TargetItems = "Subject",
Criteria = "Status = 'Deferred'", BackColor = "MistyRose")]
[RuleCriteria("EndDate >= StartDate")]
public class ProjectTask : BaseObject {
// ...
}
Run the WinForms or ASP.NET application and create several project tasks. The added modules affect the applications' appearance and validation logic according to the specified settings.
运行WinForms或ASP。NET应用程序并创建多个项目任务。添加的模块根据指定的设置影响应用程序的外观和验证逻辑。
Note
Some built-in XAF modules integrate the DevExpress WinForms
and ASP.NET visual components into your application. For example, XAF provides modules for common business scenarios with the data grid and editors, navigation, menu and layout, report, chart, pivot grid, tree view, calendar and scheduler
, etc. Refer to the Extra Modules tutorial for more information.
请注意
一些内置的XAF模块集成了DevExpress WinForms
和ASP。NET可视化组件到您的应用程序中。例如,XAF为常见的业务场景提供了一些模块,包括数据网格和编辑器、导航、菜单和布局、报告、图表、数据透视网格、树视图、日历和调度器
等。有关更多信息,请参阅额外的模块教程。
Data Models from External Libraries
来自外部库的数据模型
You can add a business class to your application from the Business Class Library. XAF generates UI elements according to this class' structure. The following steps show how to add the Person class from the Business Class Library and create the Employee navigation item to display Person objects in a list.
您可以从业务类库向应用程序添加业务类。XAF根据这个类的结构生成UI元素。以下步骤演示如何从业务类库添加Person类,并创建Employee导航项以在列表中显示Person对象。
- In the Solution Explorer, double-click the Module.cs (Module.vb) file in the SimpleProjectManager.Module project to invoke the Module Designer.
In the Exported Types section, expand the Referenced Assemblies | DevExpress.Persistent.BaseImpl.v19.2 node. Classes included in the Application Model are marked in bold. The Person node is marked in bold because the Application Model has ProjectTask.AssignedTo and Project.Manager properties of this type.
在解决方案资源管理器中,双击SimpleProjectManager中的Module.cs (Module.vb)文件。调用模块设计器的模块项目。
在export Types部分,展开引用的程序集| devexpress . persistence . baseimpl .v19.2节点。应用程序模型中包含的类以粗体标记。Person节点用粗体标记,因为应用程序模型有ProjectTask。AssignedTo和项目。此类型的管理器属性。

Note
To export a type, select the corresponding class and press Space or right-click this class and choose Use Type in Application in the invoked context menu. Rebuild the project after you made changes in the Module Designer.
请注意
要导出类型,请选择相应的类并按Space或右键单击该类,然后在调用的上下文菜单中选择Use type in Application。在模块设计器中进行更改后重新生成项目。
Invoke the Model Editor for the SimpleProjectManager.Module project and navigate to the NavigationItems | Items | Planning | Items node. Create a new navigation item and set its Caption property to "Employee" and View to "Person_ListView". Refer to the Add an Item to the Navigation Control topic for more information on how to add a navigation item.
- 调用SimpleProjectManager的模型编辑器。模块项目和导航到NavigationItems |项|规划|项节点。创建一个新的导航项,并将其标题属性设置为“Employee”,将视图设置为“Person_ListView”。有关如何添加导航项的更多信息,请参阅导航控件主题中的“添加项”。

- Run an application. The navigation control shows the new item in the Planning section.
- 运行一个应用程序。导航控件在Planning部分显示新项。

Note
You can also use third-party modules
or create your own reusable modules for use in multiple XAF applications.
请注意
您还可以使用第三方模块
或者创建自己的可重用模块,以便在多个XAF应用程序中使用。
Reuse Implemented Functionality 重用实现功能的更多相关文章
- [面向对象之继承应用(在子类派生重用父类功能(super),继承实现原理(继承顺序、菱形问题、继承原理、Mixins机制),组合]
[面向对象之继承应用(在子类派生重用父类功能(super),继承实现原理(继承顺序.菱形问题.继承原理.Mixins机制),组合] 继承应用 类与类之间的继承指的是什么'是'什么的关系(比如人类,猪类 ...
- roughViz 一个可重用,功能强大的手绘图表组件
前段时间介绍过一个chart.xkcd 的手绘图表组件,roughViz 是另外一个,同时也提供了 比较多的图表类型,api 参考文档也比较全 支持的图表类型 Bar Horizontal Bar D ...
- Java 代码重用:操作与上下文重用
目录 操作重用 参数化操作 上下文重用 上下文作为模板方法 结束语 我几乎不需要讨论为什么重用代码是有利的.代码重用(通常)会导致更快的开发与更少的 BUG.一旦一段代码被封装和重用,那么检查程序是否 ...
- Oracle 数据文件 reuse 属性 说明(转载)
Oracle 表空间 创建参数 说明 http://blog.csdn.net/tianlesoftware/archive/2011/01/27/6166928.aspx 当我们对表空间添加数据文件 ...
- 使用include重用布局
尽管Android 支持各种小部件,来提供小且可以重用的交互元素,你可能还需要更大的,要求一个专门布局的重用组件.为了高效的重用整个布局,你能使用和标签在当前的布局中嵌入别的布局. 重用布局功能特别强 ...
- Python之面向对象的组合、多态、菱形问题、子类中重用父类的两种方式
一.组合 ''' 1.什么是组合 组合就是一个类的对象具备某一个属性,该属性的值是指向另外一个类的对象 2.为何用组合 组合也是用来解决类与类直接代码冗余问题的 3.如何用组合 ''' # 继承减少代 ...
- 为什么我在css里使用功能类优先
前言 我想在我们开始的学CSS语法的时候,都是从以下的流程开始的: 1.写一个CSS类选择器: .my-class { } 2.往选择器里填充CSS语法: .my-class { display fl ...
- BlackArch-Tools
BlackArch-Tools 简介 安装在ArchLinux之上添加存储库从blackarch存储库安装工具替代安装方法BlackArch Linux Complete Tools List 简介 ...
- Anti-pattern
https://en.wikipedia.org/wiki/Anti-pattern https://zh.wikipedia.org/wiki/反面模式 An anti-pattern is a c ...
随机推荐
- LeetCode刷题总结-栈、链表、堆和队列篇
本文介绍LeetCode上有关栈.链表.堆和队列相关的算法题的考点,推荐刷题20道.具体考点分类如下图: 一.栈 1.数学问题 题号:85. 最大矩形,难度困难 题号:224. 基本计算器,难度困难 ...
- Dynamics 365中使用计算字段自动编号字段实时工作流自动生成分组编码加流水号的自动编号字段值
我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...
- Android App内文档展示方案整理
一.Word.Excel.PPT 展示 1. 微软Office公开Api接口 如果文档内容不是很机密或者只是需要实现预览文档的话,可以考虑使用微软的公共Api接口实现. 微软Office公开Api地址 ...
- Redis中几个简单的概念:缓存穿透/击穿/雪崩,别再被吓唬了
Redis中几个“看似”高大上的概念,经常有人提到,某些好事者喜欢死扣概念,实战没多少,嘴巴里冒出来的全是高大上的名词,个人一向鄙视概念党,呵呵! 其实这几个概念:缓存穿透/缓存击穿/缓存雪崩,有一个 ...
- 阿里蒋晓伟谈计算引擎Flink和Spark的对比
本文整理自云栖社区之前对阿里搜索事业部资深搜索专家蒋晓伟老师的一次采访,蒋晓伟老师,认真而严谨.在加入阿里之前,他曾就职于西雅图的脸书,负责过调度系统,Timeline Infra和Messenger ...
- Consul-template+nginx实现自动负载均衡
前言 consul-template 是 Consul 的一个守护程序,使用 consul-template 可以方便快速的实现对 Consul Key/Value 存储系统的访问,可以从 KV 系统 ...
- 字节跳动——IT技术工程师面试题
.自我介绍 .项目介绍 .争对个人项目进行提问 .场景模拟 .1如何知道用户的指定视频(类似于QQ发视频)的服务是正常的 .使用appum进行自动化测试 .使用bat脚本获取进程状态,然后定时发送em ...
- Prometheus监控(二)
Prometheus监控(二) 数据类型 Counter(计数器类型) Counter类型的指标的工作方式和计数器一样,只增不减(除非系统发生了重置),Counter一般用于累计值. Gauges(仪 ...
- Selenium(九):Xpath选择器
1. Xpath选择器 1.1 Xpath语法简介 前面我们学习了CSS选择元素. 大家可以发现非常灵活.强大. 还有一种灵活.强大的选择元素的方式,就是使用Xpath表达式. XPath (XML ...
- document.write() 为什么会清空页面
很久以前遇到的问题,放着放着就忘记去研究了最近看到一篇文章总结一下作者:abloumeurl: http://blog.csdn.net/u013451157/article/details/78 ...
