学习011-08-02 String Properties(字符串属性)

String Properties(字符串属性)

XAF supports Property Editors for the string data type on all platforms. The Property Editor type depends on the underlying property’s attributes and settings specified in the Application Model.
XAF支持所有平台上字符串数据类型的属性编辑器。属性编辑器类型取决于应用程序模型中指定的基础属性的属性和设置。

  • Text editors display string properties with a fixed length (for example, 100 or 15 characters).
    文本编辑器显示具有固定长度(例如,100或15个字符)的字符串属性。
  • Memo editors display large string properties. The default List Views do not display these properties.
    备忘录编辑器显示大字符串属性。默认列表视图不显示这些属性。
  • Combo boxes display string properties with the predefined values specified in the Application Model.
    组合框显示具有应用程序模型中指定的预定义值的字符串属性。
  • Rich Text Editors can display string properties with HTML-formatted string values.
    富文本编辑器可以使用超文本标记语言格式的字符串值显示字符串属性。

The list below contains XPO-specific notes related to string properties:
下面的列表包含与字符串属性相关的XPO特定注释:

  • If you assign a StringCompressionConverter Value Converter to a string property, databases store these properties in a compressed form.
    如果将StringCompressionConverter值转换器分配给字符串属性,数据库将以压缩形式存储这些属性。
  • You can use the Delayed Loading feature to improve performance when handling unlimited size properties.
    您可以使用延迟加载功能来提高处理无限大小属性时的性能。

Refer to the following topics for information on how to add string properties to business classes in the supported ORM systems:
有关如何在支持的ORM系统中将字符串属性添加到业务类的信息,请参阅以下主题:

  • String Properties in XPO(XPO中的字符串属性)
  • String Properties in EF Core(EF Core中的字符串属性)

ASP.NET Core Blazor

In ASP.NET Core Blazor, BlazorPropertyEditorBase.ComponentModel returns an IComponentModel descendant that wraps properties and events of a corresponding ASP.NET Core Blazor Editor.
在ASP.NET Core Blazor中,BlazorPropertyEditorBaseComponentModel返回一个IComponentModel后代,它包装了相应ASP.NET Core Blazor Editor的属性和事件。

StringPropertyEditor

IComponentContentHolder descendant:
IComponentContentHolder后裔:
The table below shows the match between the IComponentContentHolder descendant type and the resulting UI component type.
下表显示了IComponentContentHolder后代类型和生成的UI组件类型之间的匹配。
在这里插入图片描述

在这里插入图片描述

Description:
描述:

This is the default Property Editor for string properties.
这是字符串属性的默认属性编辑器。

Hide the Clear Button(隐藏清除按钮)

DxTextBox and DxMaskedInput display the Clear button when the editor’s value is not empty. To hide this button, ensure that the editor’s ClearButtonDisplayMode property is set to DevExpress.Blazor.DataEditorClearButtonDisplayMode.Never.
当编辑器的值不为空时,DxTextBox和DxMaskedInput显示清除按钮。要隐藏此按钮,请确保编辑器的ClearButtonDisplayMode属性设置为 DevExpress.Blazor.DataEditorClearButtonDisplayMode.Never。

The example below hides the Clear button in all DxTextBox components.
下面的示例隐藏了所有DxTextBox组件中的Clear按钮。

C#
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Blazor.Editors;


public class CustomizeStringPropertyEditorController : ViewController {


    protected override void OnActivated() {
        base.OnActivated();
        if(View is ListView { Editor: DxGridListEditor gridListEditor }) {
            gridListEditor.CustomizeViewItemControl<StringPropertyEditor>(this, CustomizePropertyEditor);
        }
        else if(View is DetailView detailView) {
            detailView.CustomizeViewItemControl<StringPropertyEditor>(this, CustomizePropertyEditor);
        }
    }


    private void CustomizePropertyEditor(StringPropertyEditor stringPropertyEditor) {
        if (stringPropertyEditor.ComponentModel is DxTextBoxModel textBox)
            textBox.ClearButtonDisplayMode = DevExpress.Blazor.DataEditorClearButtonDisplayMode.Never;
    }
}
Customize Mask Properties of a Masked Input Component(自定义掩码输入组件的掩码属性)

To customize mask properties of a masked input component, specify the MaskMode property explicitly:
要自定义掩码输入组件的掩码属性,请显式指定MaskMode属性:

C#
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Blazor.Components.Models;
using DevExpress.ExpressApp.Blazor.Editors;


namespace YourApplicationName.Module.Controllers {
    public class CustomizeMaskPropertiesController : ViewController<DetailView> {
        protected override void OnActivated() {
            base.OnActivated();
            View.CustomizeViewItemControl<StringPropertyEditor>(this, editor => {
                if(editor.ComponentModel is DxMaskedInputModel maskedInput) {
                    maskedInput.MaskMode = DevExpress.Blazor.MaskMode.Text;
                    editor.DxMaskedInputMaskProperties.Text.Placeholder = '?';
                }
            });
        }
    }
}

RichTextPropertyEditor

在这里插入图片描述

Component Model: DevExpress.ExpressApp.Blazor.Components.Models.DxRichEditModel.
组件模型:DevExpress. ExpressApp.Blazor.Components.Model.DxRichEditModel。

Component: the DxRichEdit editor shipped with the DevExpress ASP.NET Core Blazor Library.
组件:DxRichEdit编辑器随DevExpressASP.NET核心Blazor库一起提供。

Description:
描述:

You can use this editor for string properties in List and Detail Views. The editor is supplied with the Office Module.
您可以将此编辑器用于列表和详细信息视图中的字符串属性。编辑器随Office模块提供。

RichTextPropertyEditor allows you to edit rich text documents stored in RTF or HTML format. For more information, refer to the following topic: Use Rich Text Documents in Business Objects.
RichTextPropertyEditor允许您编辑以RTF或超文本标记语言格式存储的富文本文档。有关详细信息,请参阅以下主题:在业务对象中使用富文本文档。

WinForms

Each Windows Forms Property Editor is available in two forms:
每个Windows窗体属性编辑器都有两种形式:

  • A standalone control (displays property value in a Detail View)
    独立控件(在详细信息视图中显示属性值)
  • A repository item (displays property value in a List Editor that supports in-place editing)
    存储库项(在支持就地编辑的列表编辑器中显示属性值)

StringPropertyEditor

在这里插入图片描述

Controls:
控件:

  • StringEdita descendant of the TextEdit editor shipped with the XtraEditors Library.
    StringEdit-XtraEditor库附带的TextEdit编辑器的后代。
  • PredefinedValuesStringEdita descendant of the ComboBoxEdit editor shipped with the XtraEditors Library.
    PredefinedValuesStringEdit-XtraEditor库附带的ComboBoxEdit编辑器的后代。
  • LargeStringEdita descendant of the MemoEdit editor shipped with the XtraEditors Library.
    LargeStringEdit-XtraEditor库附带的MemoEdit编辑器的后代。

Repository Items:
存储库项目:

  • RepositoryItemStringEdita descendant of the RepositoryItemTextEdit item shipped with the XtraEditors Library.
    RepositoryItemStringEdit-XtraEditor库附带的RepositoryItemTextEdit项的后代。
  • RepositoryItemPredefinedValuesStringEdita descendant of the RepositoryItemComboBox item shipped with the XtraEditors Library.
    RepositoryItemPredefinedValuesStringEdit-XtraEditor库附带的RepositoryItemComboBox项的后代。
  • A RepositoryItemMemoExEdit item shipped with the XtraEditors Library.
    XtraEditor库附带的RepositoryItemMemoExEdit项。

Description:
描述:

This is the default Property Editor for string properties.
这是字符串属性的默认属性编辑器。

The StringEdit control and the RepositoryItemStringEdit item are used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s RowCount property is set to 0 (default) or 1.
当对应的BOModel|<Class>|OwnMembers|< Member>节点的RowCount属性设置为0(默认)或1时,将使用StringEdit控件和RepositoryItemStringEdit项。

The PredefinedValuesStringEdit control and RepositoryItemPredefinedValuesStringEdit items are used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s RowCount property is set to 0 or 1, and the PredefinedValues property is specified. Press Alt+Down Arrow to expand the control’s drop-down window.
当对应的 BOModel | <Class> | OwnMembers | <Member>节点的RowCount属性设置为0或1,并指定了预定值属性时,将使用PredefinedValuesStringEdit控件和RepositoryItemPredefinedValuesStringEdit项。按 Alt+Down Arrow展开控件的下拉窗口。

The LargeStringEdit control and RepositoryItemMemoExEdit repository items are used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s RowCount property value exceeds 1. Note that this property affects only the minimum height of the LargeStringEdit control. The actual height is determined by the available space.
LargeStringEdit控件和RepositoryItemMemoExEdit存储库项在对应的 BOModel | <Class> | OwnMembers | <Member>节点的RowCount属性值超过1时使用。请注意,此属性仅影响LargeStringEdit控件的最小高度。实际高度由可用空间决定。

You can specify a mask for StringPropertyEditor. See the following topics for more information:
可以为StringPropertyEditor指定掩码。有关详细信息,请参阅以下主题:

  • MaskSettings
  • Input Mask
  • Format a Property Value

Note
The StringEdit control and the RepositoryItemStringEdit item can be used to display a non-string property. For this purpose, assign the DevExpress.ExpressApp.Win.Editors.StringPropertyEditor Property Editor for the required BOModel | <Class> | OwnMembers | <Member> node’s PropertyEditorType property. In this instance, the StringEdit control shows the property’s display text.
StringEdit控件和RepositoryItemStringEdit项可用于显示非字符串属性。为此,为所需的BOModel | <Class> | OwnMembers | <Member>节点的属性分配DevExpress.ExpressApp.Win. Editor.StringPropertyEditor属性编辑器。在这种情况下,StringEdit控件显示属性的显示文本。

RichTextPropertyEditor

在这里插入图片描述

Control: RichEditorContainera wrapper for the RichEditControl control shipped with the XtraEditors Library.
控件:RichEditorContainer-XtraEditor库附带的RichEditControl控件的包装器。

Repository Item: a RepositoryItemRichTextEdit item shipped with the XtraEditors Library.
存储库项:XtraEditor库附带的RepositoryItemRichTextEdit项。

Description:
描述:
Intended for string properties and can be used in List and Detail Views. This Property Editor is supplied with the Office Module. This Property Editor allows you to edit rich text documents stored in the RTF or HTML format and create Mail Merge templates. Refer to the Use Rich Text Documents in Business Objects topic for more information about the RichTextPropertyEditor.
用于字符串属性,可用于列表和详细信息视图。此属性编辑器随Office模块提供。此属性编辑器允许您编辑以RTF或超文本标记语言格式存储的富文本文档,并创建邮件合并模板。有关RichTextPropertyEditor的更多信息,请参阅在业务对象中使用富文本文档主题。

ASP.NET Web Forms

Each ASP.NET Web Forms Property Editor includes controls that display a property in a Detail View in View and Edit mode.
每个ASP.NETWeb窗体属性编辑器都包含在查看和编辑模式下的详细信息视图中显示属性的控件。

ASPxStringPropertyEditor

在这里插入图片描述

View mode control: Label.
查看模式控件:标签。

Edit mode controls:
编辑模式控件:

  • An ASPxTextBox editor shipped with the ASPxEditors Library.
    随ASPxEditor库一起提供的ASPxTextBox编辑器。
  • An ASPxMemo editor shipped with the ASPxEditors Library.
    随ASPxEditor库一起提供的ASPxMemo编辑器。
  • An ASPxComboBox editor shipped with the ASPxEditors Library.
    随ASPxEditor库一起提供的ASPxComboBox编辑器。

Description:
描述:

This is the default Property Editor for string properties.
这是字符串属性的默认属性编辑器。

The ASPxTextBox control is used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s IModelCommonMemberViewItem.RowCount property is set to 0 (default) or 1.
当对应的 BOModel | <Class> | OwnMembers | <Member>节点IModelCommonMemberViewItem时,使用ASPxTextBox控件。RowCount属性设置为0(默认)或1。

The ASPxMemo control is used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s IModelCommonMemberViewItem.RowCount property value exceeds 1.
当对应的BOModel | <Class> | OwnMembers | <Member>节点的IModelCommonMemberViewItem时,使用ASPxMemo控件。RowCount属性值超过1。

The ASPxComboBox control is used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s PredefinedValues property is specified. Press the Alt+Down Arrow keystroke to expand the control’s drop-down window.
当指定了相应 BOModel | <Class> | OwnMembers | <Member>节点的预定值属性时,使用ASPxComboBox控件。按Alt+Down箭头击键展开控件的下拉窗口。

ASPxRichTextPropertyEditor

在这里插入图片描述

View and Edit mode control: An ASPxRichEdit editor shipped with the ASPxEditors Library.
查看和编辑模式控件:ASPxRichEdit编辑器随ASPxEditor库一起提供。

Description:
描述:
Intended for string properties and can be used in List and Detail Views. This Property Editor is supplied with the Office Module. This Property Editor allows you to edit rich text documents stored in the RTF or HTML format and create Mail Merge templates. Refer to the Use Rich Text Documents in Business Objects topic for more information about the ASPxRichTextPropertyEditor.
用于字符串属性,可用于列表和详细信息视图。此属性编辑器随Office模块提供。此属性编辑器允许您编辑以RTF或超文本标记语言格式存储的富文本文档,并创建邮件合并模板。有关ASPxRichTextPropertyEditor的更多信息,请参阅在业务对象中使用富文本文档主题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

汤姆•猫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值