共用方式為


CharacterGroupings 類別

定義

包含一組字元群組,以及取得任何指定字串標籤的功能。

public ref class CharacterGroupings sealed : IIterable<CharacterGrouping ^>, IVectorView<CharacterGrouping ^>
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class CharacterGroupings final : IIterable<CharacterGrouping>, IVectorView<CharacterGrouping>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class CharacterGroupings final : IIterable<CharacterGrouping>, IVectorView<CharacterGrouping>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.Collation.ICharacterGroupingsFactory, 262144, "Windows.Foundation.UniversalApiContract")]
class CharacterGroupings final : IIterable<CharacterGrouping>, IVectorView<CharacterGrouping>
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class CharacterGroupings : IEnumerable<CharacterGrouping>, IReadOnlyList<CharacterGrouping>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class CharacterGroupings : IEnumerable<CharacterGrouping>, IReadOnlyList<CharacterGrouping>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.Collation.ICharacterGroupingsFactory), 262144, "Windows.Foundation.UniversalApiContract")]
public sealed class CharacterGroupings : IEnumerable<CharacterGrouping>, IReadOnlyList<CharacterGrouping>
function CharacterGroupings()
function CharacterGroupings(language)
Public NotInheritable Class CharacterGroupings
Implements IEnumerable(Of CharacterGrouping), IReadOnlyList(Of CharacterGrouping)
繼承
Object Platform::Object IInspectable CharacterGroupings
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

// Create a CharacterGroupings object for the default collation.
var characterGroupings = new Windows.Globalization.Collation.CharacterGroupings();
// Get the number of CharacterGrouping objects.
var size = characterGroupings.size;
if (size > 0) {
    // Get the first characterGrouping.
    var characterGrouping = characterGroupings.getAt(0);
    // Get the first item in this characterGrouping.
    var first = characterGrouping.first;
    // Get the label of the first item in this characterGrouping.
    var label = characterGrouping.label;
}

備註

集合成員清單

針對 JavaScript,CharacterGroupings 具有成員清單中顯示的成員。 此外,CharacterGroupings 也支援 length 屬性、 Array.prototype的成員,以及使用索引來存取專案。

列舉 C# 或 Microsoft Visual Basic 中的集合

CharacterGroupings 是可列舉的,因此您可以使用 C# 中的 foreach 之類的語言特定語法來列舉集合中的專案。 編譯器會為您執行類型轉換,而且您不需要明確地轉換 。 IEnumerable<CharacterGrouping> 如果您需要明確轉換,例如,如果您想要呼叫GetEnumerator,請使用CharacterGrouping條件約束轉換成IEnumerable < T >

版本歷程記錄

Windows 版本 SDK 版本 新增值
1703 15063 CharacterGroupings (String)

建構函式

CharacterGroupings()

建立預設定序的 CharacterGroupings 物件。

CharacterGroupings(String)

為屬於指定語言的定序建立 CharacterGroupings 物件。

屬性

Size

取得字元群組集合中的 CharacterGrouping 物件數目。

方法

First()

傳回反覆運算器,以列舉字元群組集合中的專案。

GetAt(UInt32)

傳回字元群組集合中位於指定索引處的 CharacterGrouping

GetMany(UInt32, CharacterGrouping[])

會傳回從字元群組集合中指定索引開始的 CharacterGrouping 物件。

IndexOf(CharacterGrouping, UInt32)

傳回字元群組集合中指定 CharacterGrouping 物件的索引。

Lookup(String)

取得所提供文字所在的標籤。

適用於