MessageFormat.SetFormatsByArgumentName 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
[加護病房] 設定用於傳遞給 format 方法或從方法回 parse 傳的值的 Format 物件。
[Android.Runtime.Register("setFormatsByArgumentName", "(Ljava/util/Map;)V", "GetSetFormatsByArgumentName_Ljava_util_Map_Handler", ApiSince=24)]
public virtual void SetFormatsByArgumentName(System.Collections.Generic.IDictionary<string,Java.Text._Format>? newFormats);
[<Android.Runtime.Register("setFormatsByArgumentName", "(Ljava/util/Map;)V", "GetSetFormatsByArgumentName_Ljava_util_Map_Handler", ApiSince=24)>]
abstract member SetFormatsByArgumentName : System.Collections.Generic.IDictionary<string, Java.Text._Format> -> unit
override this.SetFormatsByArgumentName : System.Collections.Generic.IDictionary<string, Java.Text._Format> -> unit
參數
- newFormats
- IDictionary<String,_Format>
一個從 String 到 Format 的映射,提供命名參數的新格式。
- 屬性
備註
[加護病房] 設定用於傳遞給 format 方法或從方法回 parse 傳的值的 Format 物件。 鍵 的 newFormats 是先前設定的模式字串中的參數名稱,而值則是格式。
僅考慮模式字串中的參數名稱。 對於與參數名稱不符的額外鍵 newFormats 數會被忽略。 同樣地,如果 newFormats 中沒有參數名稱的格式,該參數的格式化器保持不變。
此功能可能用於不使用命名參數的格式。 此時會查詢代表參數索引的鍵字串,例如「0」、「1」、「2」等。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。