ProductListing 類別

定義

提供當地語系化的資訊,詳細說明附加元件 (也稱為應用程式內產品或 IAP) 。

public ref class ProductListing sealed
/// [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 ProductListing final
[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 ProductListing
Public NotInheritable Class ProductListing
繼承
Object Platform::Object IInspectable ProductListing
屬性

Windows 需求

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

範例

此處的程式碼範例示範如何從模擬的應用程式資料取得 ListingInformation ,然後取得附加元件 ProductListing 物件。

// get the license info for this app from the simulator
ListingInformation listing = await CurrentAppSimulator.LoadListingInformationAsync();

// get the ProductListing object for the product named "product1"
ProductListing thisProduct = listing.ProductListings["product1"];

// format the purchase string or this in-app offer
String purchasePrice = "You can buy " + thisProduct.Name + 
    " for: " + thisProduct.FormattedPrice + ".";

備註

您可以挑選ListInformation物件之ProductListings屬性傳回的集合元素,以存取此物件。

版本歷程記錄

Windows 版本 SDK 版本 已新增值
1511 10586 CurrencyCode
1511 10586 FormattedBasePrice
1511 10586 IsOnSale
1511 10586 SaleEndDate

屬性

CurrencyCode

取得與使用者市場相關聯的貨幣代碼,例如 美元CAD

Description

取得附加元件 (也稱為應用程式內產品或 IAP) 的描述。

FormattedBasePrice

取得附加元件 (也稱為應用程式內產品或 IAP) 的基底價格,其格式適用于目前市場。

FormattedPrice

取得應用程式內產品的購買價格,其格式適用于目前市場。

ImageUri

取得與附加元件相關聯的映射 URI, (也稱為應用程式內產品或 IAP) 。

IsOnSale

取得值,指出附加元件 (也稱為應用程式內產品或 IAP) 是否在銷售中。

Keywords

取得與附加元件相關聯的關鍵字清單, (也稱為應用程式內產品或 IAP) 。 這些字串會對應至合作夥伴中心附加元件的 [屬性] 頁面中的[關鍵字]欄位值。 例如,呼叫 LoadListingInformationByKeywordsAsync時,這些關鍵字適用于依關鍵字篩選產品清單。

Name

取得附加元件 (的描述性名稱,也稱為應用程式內產品或 IAP) ,該產品會顯示在目前市場的客戶。

ProductId

取得這個 ProductListing 所代表之附加元件的產品識別碼。

ProductType

取得此附加元件的類型, (也稱為應用程式內產品或 IAP) 。 ProductType 會定義可能的值。

SaleEndDate

取得附加元件 (也稱為應用程式內產品或 IAP) 的銷售期間結束日期。

Tag

取得自訂開發人員資料字串 (也稱為標籤) ,其中包含附加元件 (也稱為應用程式內產品或 IAP) 的自訂資訊。 此字串會對應至合作夥伴中心附加元件之屬性頁面中的[自訂開發人員資料] 欄位值。

適用於

另請參閱