wp7 判断是否试用模式

在SL程序的lauch 和 active 时调用

using Microsoft.Phone.Marketplace;

    LicenseInformation _licenseInformation = new LicenseInformation();
    bool _isTrial = _licenseInformation.IsTrial();



XNA中


用 Guide.IsTrialMode判断是否使用模式。


用下面代码测试

#if DEBUG
            Guide.SimulateTrialMode = true;
#endif


用下面代码进入marketplace 

Guide.ShowMarketplace(PlayerIndex.One);


用下面代码提示购买完整版

                    // MessageBox will have "OK" and "Cancel" buttons
                    List<String> mbList = new List<string>();
                    mbList.Add("OK");
                    mbList.Add("Cancel");
                        
                    // BeginShowMessageBox is asynchronous. We define the method PromptPurchase as the callback
                    Guide.BeginShowMessageBox("Level 1 Complete", "Click OK to buy the game.", mbList, 0, 
                                                MessageBoxIcon.None, PromptPurchase, null);

        private void PromptPurchase(IAsyncResult ar)
        {
            // Complete the ShowMessageBox operation and get the index of the button that was clicked.
            int? result = Guide.EndShowMessageBox(ar);


            // Clicked "OK", so bring the user to the application's marketplace page to buy the application.
            if (result.HasValue && result == 0)
            {
                Guide.ShowMarketplace(PlayerIndex.One);
            }
            else
            {
                // User did not want to go to the marketplace to buy the application.
                // stay at level one.
                ResetGameCounters();
            }


            // Resume the game if it had been paused.
            if (paused || pausedForGuide)
                EndPause();
        }


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值