当前位置: 首页>>代码示例>>C#>>正文


C# UInt64.Equals方法代码示例

本文整理汇总了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);
        }
开发者ID:HarleyCarter1234,项目名称:piwik-dotnet-tracker,代码行数:49,代码来源:PiwikTracker.cs


注:本文中的System.UInt64.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。