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 类属性与实例属性

    #__author__ = 'juzi_juzi' #类属性与实例属性 #1.无法通过类访问实例属性: #2.类属性归类所所有,但是所有实例都可访问: #3.如果存在相同名称的类属性与实例属性,实例访 ...

  2. javascript的ES6学习总结(第三部分)

    1.ES6中的面向对象的类 1.1.定义类 在ES5中,我们写一个类,通常是这么写的 function Person(name,age){ this.name = name; this.age = a ...

  3. git 本地代码 切换远程分支

    公司之前代码使用的是gitlab,后来换成腾讯的工峰,所以需要切换远程不支,所以在原代码上切换即可. 在原项目打开git bash命令,打开后会显示本地的原始分支 打开后 添加新的远程分支,红色字体为 ...

  4. IO测试工具 - 用于IO测试 ; linux benchmarks

    IO测试工具,用于磁盘IO测试,下面进行使用列表进行记录: iozone fio dd ioping iotop iostat bonnie++ crystalDisk Atto as-ssd-ben ...

  5. i2c_msg 标志位 - repeat-start

    i2c_msg标志位      路径:linux-2.6.38/include/linux/i2c.h I2C_M_IGNORE_NAK: 设置这个标志意味当前i2c_msg忽略I2C器件的ack和n ...

  6. 搭建API Mock

    所需环境 Node.js + MySQL 5.7+ Redis 4.0+ Node.js 安装 .要安装nvm,需要安装构建源包所需的工具,CentOS 上安装,用这些命令来安装构建工具: sudo ...

  7. .Net Core 项目发布到Linux - CentOS 7(一)

    由于项目的需求,需要发布到Linux服务器上,在这里记录一下我发布的过程. 安装Linux 安装liunx系统很简单,网上也有很多教程,我是直接使用阿里云的CentOS 7.7 64位 部署环境 Li ...

  8. Delphi CreateProcess 创建一个新的进程和它的主线程

    Delphi CreateProcess WIN32API函数CreateProcess用来创建一个新的进程和它的主线程,这个新进程运行指定的可执行文件 CreateProcess百科名片 WIN32 ...

  9. 探索Dynamics 365 用户能够登录使用的最小权限需求

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  10. MySQL数据库~~~~pymysql 连接 MySQL的客户端

    import pymysql conn = pymysql.connect( host = '127.0.0.1', # 主机 port = 3306, # 端口号 user = 'root', # ...