Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 27 additions & 14 deletions src/BootstrapBlazor/Attributes/AutoGenerateBaseAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,74 +1,87 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone

namespace BootstrapBlazor.Components;

/// <summary>
/// Base class for AutoGenerateColumn attribute, used to mark auto-generated columns in <see cref="Table{TItem}"/>
/// <para lang="zh">AutoGenerateColumn 属性基类,用于标记 <see cref="Table{TItem}"/> 中的自动生成列</para>
/// <para lang="en">Base class for AutoGenerateColumn attribute, used to mark auto-generated columns in <see cref="Table{TItem}"/></para>
/// </summary>
public abstract class AutoGenerateBaseAttribute : Attribute
{
/// <summary>
/// Gets or sets whether the current column is editable. Default is true. When set to false, the auto-generated edit UI will not generate this column.
/// <para lang="zh">获得/设置 当前列是否可编辑。默认为 true。当设置为 false 时,自动编辑 UI 不会生成此列。</para>
/// <para lang="en">Gets or sets whether the current column is editable. Default is true. When set to false, the auto-generated edit UI will not generate this column.</para>
/// </summary>
[Obsolete("Deprecated. If it is editable, use the Readonly parameter. If it is visible, use the Ignore parameter.")]
[ExcludeFromCodeCoverage]
public bool Editable { get; set; } = true;

/// <summary>
/// Gets or sets whether the current column is rendered. Default is false. When set to true, the UI will not generate this column.
/// <para lang="zh">获得/设置 当前列是否渲染。默认为 false。当设置为 true 时,UI 不会生成此列。</para>
/// <para lang="en">Gets or sets whether the current column is rendered. Default is false. When set to true, the UI will not generate this column.</para>
/// </summary>
public bool Ignore { get; set; }

/// <summary>
/// Gets or sets whether the current edit item is read-only. Default is false.
/// <para lang="zh">获得/设置 当前编辑项是否只读。默认为 false。</para>
/// <para lang="en">Gets or sets whether the current edit item is read-only. Default is false.</para>
/// </summary>
public bool Readonly { get; set; }

/// <summary>
/// Gets or sets whether the current edit item is visible. Default is true.
/// <para lang="zh">获得/设置 当前编辑项是否可见。默认为 true。</para>
/// <para lang="en">Gets or sets whether the current edit item is visible. Default is true.</para>
/// </summary>
public bool Visible { get; set; } = true;

/// <summary>
/// Gets or sets whether sorting is allowed. Default is false.
/// <para lang="zh">获得/设置 是否允许排序。默认为 false。</para>
/// <para lang="en">Gets or sets whether sorting is allowed. Default is false.</para>
/// </summary>
public bool Sortable { get; set; }

/// <summary>
/// Gets or sets whether data filtering is allowed. Default is false.
/// <para lang="zh">获得/设置 是否允许数据筛选。默认为 false。</para>
/// <para lang="en">Gets or sets whether data filtering is allowed. Default is false.</para>
/// </summary>
public bool Filterable { get; set; }

/// <summary>
/// Gets or sets whether the column participates in search. Default is false.
/// <para lang="zh">获得/设置 此列是否参与搜索。默认为 false。</para>
/// <para lang="en">Gets or sets whether the column participates in search. Default is false.</para>
/// </summary>
public bool Searchable { get; set; }

/// <summary>
/// Gets or sets whether text wrapping is allowed in this column. Default is false.
/// <para lang="zh">获得/设置 此列是否允许文本换行。默认为 false。</para>
/// <para lang="en">Gets or sets whether text wrapping is allowed in this column. Default is false.</para>
/// </summary>
public bool TextWrap { get; set; }

/// <summary>
/// Gets or sets whether text overflow is ellipsis in this column. Default is false.
/// <para lang="zh">获得/设置 此列文本溢出时是否显示省略号。默认为 false。</para>
/// <para lang="en">Gets or sets whether text overflow is ellipsis in this column. Default is false.</para>
/// </summary>
public bool TextEllipsis { get; set; }

/// <summary>
/// Gets or sets the text alignment. Default is Alignment.None.
/// <para lang="zh">获得/设置 文本对齐方式。默认为 Alignment.None。</para>
/// <para lang="en">Gets or sets the text alignment. Default is Alignment.None.</para>
/// </summary>
public Alignment Align { get; set; }

/// <summary>
/// Gets or sets whether to show tooltips on mouse hover. Default is false.
/// <para lang="zh">获得/设置 鼠标悬停时是否显示提示信息。默认为 false。</para>
/// <para lang="en">Gets or sets whether to show tooltips on mouse hover. Default is false.</para>
/// </summary>
public bool ShowTips { get; set; }

/// <summary>
/// Gets or sets whether the column can be copied. Default is false.
/// <para lang="zh">获得/设置 列是否可以被复制。默认为 false。</para>
/// <para lang="en">Gets or sets whether the column can be copied. Default is false.</para>
/// </summary>
public bool ShowCopyColumn { get; set; }
}
5 changes: 3 additions & 2 deletions src/BootstrapBlazor/Attributes/AutoGenerateClassAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone

namespace BootstrapBlazor.Components;

/// <summary>
/// AutoGenerateColumn attribute class, used to mark auto-generated columns in <see cref="Table{TItem}"/>
/// <para lang="zh">AutoGenerateColumn 属性类,用于在 <see cref="Table{TItem}"/> 中标记自动生成的列</para>
/// <para lang="en">AutoGenerateColumn attribute class, used to mark auto-generated columns in <see cref="Table{TItem}"/></para>
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class AutoGenerateClassAttribute : AutoGenerateBaseAttribute
Expand Down
Loading