本文整理匯總了C#中System.UInt64.Equals方法的典型用法代碼示例。如果您正苦於以下問題:C# UInt64.Equals方法的具體用法?C# UInt64.Equals怎麽用?C# UInt64.Equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.UInt64
的用法示例。
在下文中一共展示了UInt64.Equals方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: addEcommerceItem
/// <summary>
/// Adds an item in the Ecommerce order.
///
/// This should be called before doTrackEcommerceOrder(), or before doTrackEcommerceCartUpdate().
/// This function can be called for all individual products in the cart (or order).
/// SKU parameter is mandatory. Other parameters are optional (set to false if value not known).
/// Ecommerce items added via this function are automatically cleared when doTrackEcommerceOrder() or getUrlTrackEcommerceOrder() is called.
/// </summary>
/// <param name="sku">SKU, Product identifier </param>
/// <param name="name">Product name</param>
/// <param name="category">Product category</param>
/// <param name="price"> Individual product price (supports integer and decimal prices)</param>
/// <param name="quantity">Product quantity. If not specified, will default to 1 in the Reports</param>
public void addEcommerceItem(string sku, string name = null, string category = null, double price = Double.MinValue, UInt64 quantity = UInt64.MinValue)
{
if(String.IsNullOrEmpty(sku))
{
throw new Exception("You must specify a SKU for the Ecommerce item");
}
string sanitizedName = name;
if (name == null)
{
sanitizedName = "false";
}
string sanitizedCategory = category;
if (category == null)
{
sanitizedCategory = "false";
}
string priceString = formatMonetaryValue(price);
if (price.Equals(Double.MinValue))
{
priceString = "false";
}
string quantityString = quantity.ToString();
if (quantity.Equals(UInt64.MinValue))
{
quantityString = "false";
}
string[] eCommerceItem = { sku, sanitizedName, sanitizedCategory, priceString, quantityString };
ecommerceItems.Remove(sku);
ecommerceItems.Add(sku, eCommerceItem);
}