In this lesson, you will learn how to modify Action properties. The ClearTasks Action will be used. To see how the Action was implemented, refer to the Add a Simple Action lesson. In this lesson, you will add a tooltip, confirmation message and shortcut to it.

在本课中,您将学习如何修改 Action 属性。将使用清除任务操作。要查看操作是如何实现的,请参阅添加简单按钮课程。在本课中,您将向其添加工具提示、确认消息和快捷方式。

Note 注意

Before proceeding, take a moment to review the following lessons.

在继续之前,请花点时间复习以下课程。

  • Add a Simple Action
  • Place an Action in a Different Location
  • Since the ClearTasksAction is implemented in the common application module, you can specify its properties directly in this module. To do this, invoke the Model Editor by double-clicking the Model.DesignedDiffs.xafml file in the MySolution.Module project:
  • In the Model Editor, navigate to the ActionDesign | Actions node. Locate the ClearTasksAction node. To the right, the Action's settings are represented by properties. These properties are separated into collapsible categories.
  • Navigate to the Misc category. By default, the Tooltip property is set to Caption. Set it to "Clear the current Contact's tasks" instead. Set the Shortcut property to "Control+Shift+C", to specify a shortcut for the Action. Note that the specified shortcut will be displayed along with the Tooltip property value in the Action's tooltip. By default, the ConfirmationMessage property is set to the Action's ActionBase.ConfirmationMessage property value, which is specified in code. Replace this value with "Are you sure you want to clear the {0}'s Tasks list?". The "{0}" format item will be substituted with the object's default property value. A property can be specified as default via the DefaultProperty property of the BOModel | <Class> node in the Model Editor. Alternatively, the DefaultProperty attribute can be applied to the property's business class declaration.

  • 添加简单操作
  • 将操作放置在其他位置
  • 由于 ClearTasksAction 是在通用应用程序模块中实现的,因此可以直接在此模块中指定其属性。为此,请通过双击"模型.设计Diffs.xafml"项目中的"模型编辑器"来调用模型编辑器:
  • 在模型编辑器中,导航到操作设计 |操作节点。找到"清除任务操作"节点。在右侧,操作的设置由属性表示。这些属性被分隔成可折叠的类别。
  • 导航到杂项类别。默认情况下,"工具提示"属性设置为"标题"。请改为将其设置为"清除当前联系人的任务"。将快捷方式属性设置为"控制_Shift_C",以指定操作的快捷方式。请注意,指定的快捷方式将与"工具提示"工具提示中的"工具提示"属性值一起显示。默认情况下,"确认消息"属性设置为操作的操作Base.确认消息属性值,该属性值在代码中指定。将此值替换为"是否确实要清除{0}的任务列表?""{0}"格式项将替换为对象的默认属性值。可以通过 BOModel 的"默认属性"属性将属性指定为默认值 |模型编辑器中的<Class>节点。或者,DefaultProperty 属性可以应用于属性的业务部门级声明。
Note 注意
Shortcuts are defined by simple strings that you need to type manually. The IModelAction.Shortcut property is used to parse the strings. Note that shortcuts will only work in a WinForms application.

快捷方式由需要手动键入的简单字符串定义。IModelAction.快捷方式属性用于分析字符串。请注意,快捷方式仅在 WinForms 应用程序中工作。

The current object identifier will be inserted into the confirmation message if the Action's SelectionDependencyType property is not set to "Independent". So, assign the "RequireSingleObject" value to the SelectionDependencyType property. This property belongs to the Behavior category. You can also set this property to "RequireMultipleObjects". In this case, the count of selected objects will be substituted to the confirmation message.
如果操作的"选择依赖类型"属性未设置为"独立",则当前对象标识符将插入到确认消息中。因此,将"需要单一对象"值分配给选择依赖类型属性。此属性属于行为类别。您还可以将此属性设置为"需要多个对象"。在这种情况下,所选对象的计数将替换为确认消息。

  • Run the WinForms or ASP.NET application and invoke the Detail View of any object, by double-clicking an existing one or creating a new one. Check to see if the Clear Tasks button has the required tooltip, can be executed via the specified shortcut, and a confirmation message with the specified text is invoked.
  • 通过双击现有对象或创建新对象,运行 WinForms 或ASP.NET应用程序并调用任何对象的详细信息视图。检查"清除任务"按钮是否具有所需的工具提示,是否可以通过指定的快捷方式执行,并调用包含指定文本的确认消息。

WinForms Application

WinForms 应用程序

ASP.NET Application

ASP.NET应用程序

Note 注意

You can also set an image for an Action. For details, refer to the Assign a Custom Image topic.

您还可以为操作设置图像。有关详细信息,请参阅分配自定义图像主题。

You can see the changes made in this lesson in the Model Editor invoked for the Model.DesignedDiffs.xafml file, located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

您可以在本课中为模型调用的模型编辑器中所做的更改。主演示模块项目。主演示应用程序安装在%PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

.

Specify Action Settings 指定按钮设置的更多相关文章

  1. loadrunner 运行脚本-Run-time Settings之Pacing设置

    运行脚本-Run-time Settings之Pacing设置 by:授客 QQ:1033553122   As soon as the previous iteration ends 前一个迭代一结 ...

  2. loadrunner 运行脚本-Run-time Settings之Preferences设置

    运行脚本-Run-time Settings之Preferences设置 by:授客 QQ:1033553122 打开Preferences设置对话框,这里提供了对运行时的参数选择设置 Enable ...

  3. asp.net 微信企业号办公系统-流程设计--流程步骤设置-按钮设置

    按钮设置是配置当前步骤的处理者可以执行哪些操作,每个按钮都有对应的执行脚本(javascript脚本). 从左边的按钮列表中选择当前步骤需要的按钮. 注意:如果是流程最后一步则要配置完成按钮而不是发送 ...

  4. javascript 回车提交指定按钮

    当页面上有多个提交按钮时,使用回车键会触发第一个按钮的点击事件.现在我们想触发指定按钮的提交,只需要在最后输入的文本框中加入 onkeydown 事件,如下 <asp:TextBox ID=&q ...

  5. .NET开源工作流RoadFlow-流程设计-流程步骤设置-按钮设置

    按钮设置是配置当前步骤的处理者可以执行哪些操作,每个按钮都有对应的执行脚本(javascript脚本). 从左边的按钮列表中选择当前步骤需要的按钮. 注意:如果是流程最后一步则要配置完成按钮而不是发送 ...

  6. C# winform 按钮设置左边图标

    按钮设置操作如下: 1.先设置按钮图标,再设置图标的对齐方式 2.再设置按钮字体的对齐方式. 3.最后设置排列: TextImageRelation:设置为ImageBeforeText

  7. java窗口按钮设置五个方向

    java窗口按钮设置五个方向 代码如下: package Day08; import java.awt.BorderLayout;import javax.swing.JButton;import j ...

  8. iOS-UIView指定圆角设置

    圆角设置可以指定左上.左下.右上.右下角:单个指定或多个指定. ///设置圆角[左上.右上角] - (void)setCircular{ UIBezierPath *maskPath = [UIBez ...

  9. JavaFX如何为按钮设置快捷键?

    JavaFX为按钮设置快捷键的方式有很多,先说下常见的一种. 第一种: KeyCodeCombination kc1 = new KeyCodeCombination(KeyCode.W, KeyCo ...

随机推荐

  1. python同步IO编程——StringIO、BytesIO和stream position

    主要介绍python两个内存读写IO:StringIO和BytesIO,使得读写文件具有一致的接口 StringIO 内存中读写str.需要导入StringIO >>> from i ...

  2. 使用VS2005编译安装openssl1.1.1c

    1.首先获取openssl源码包 openssl-1.1.1c.tar.gz: 2.安装 ActivePerl: 2.解压源码包,打开vs2005命令行工具,通过命令行进入openssl源码包根目录: ...

  3. java月考题JSD1908第二次月考(含答案和解析)

    考试 .container { clear: both; margin: 0 auto; text-align: left; /*width: 1200px;*/ } .container:after ...

  4. MySQL数据篇 (一)存储过程实现简单的数据修改及事务的使用

    1.需求,手动给会员新增京币,并且添加分配日志,返回修改是否成功 CREATE DEFINER=`jszapi`@`%` PROCEDURE `p_allot_user_coin`(IN `_memb ...

  5. 4.Redux学习4----react-redux

    react-redux是配合redux一起使用的,其中核心组件是Provider Provider是store的提供器,用Provider则store就无需直接引入组件内,而且还可以将一个store公 ...

  6. Prometheus学习系列(七)之Prometheus PromQL说明

    前言 本文来自Prometheus官网手册1.2.3 和 Prometheus简介1.2.3 PromQL操作符 一.二元操作符 Prometheus的查询语言支持基本的逻辑运算和算术运算.对于两个瞬 ...

  7. Python中使用class(),面向对象有什么优势

    首先我是辣鸡,然后这个问题的确有点意思 首先,类是一个集合,包含了数据,操作描述的一个抽象集合 你可以首先只把类当做一个容器来使用 class Cycle: def __init__(self,r): ...

  8. Node.js C++ 插件学习指南

    Node.js插件(addons) Node.js 插件是用 C++ 编写的动态链接共享对象,可以使用 require() 函数加载到 Node.js 中,且像普通的 Node.js 模块一样被使用. ...

  9. Ted:1 Vulnhub Walkthrough

    主机层面端口扫描: ╰─ nmap -p1-65535 -sV -A 10.10.202.134 Starting Nmap 7.70 ( https://nmap.org ) at 2019-08- ...

  10. 记,NSProxy需要实现哪些方法?

    转注出:https://www.cnblogs.com/xiaobajiu/p/10799962.html 使用NSProxy做替身,代理,多继承,本质上都是用它来转发消息给真身. 观察头文件,NSP ...