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


C# global.JavaCast方法代码示例

本文整理汇总了C#中global.JavaCast方法的典型用法代码示例。如果您正苦于以下问题:C# global.JavaCast方法的具体用法?C# global.JavaCast怎么用?C# global.JavaCast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在global的用法示例。


在下文中一共展示了global.JavaCast方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnSuccess

 public void OnSuccess(global::Java.Lang.Object result)
 {
     var str = result.JavaCast<Java.Lang.String>().ToString();
     using (var helper = new OuyaEncryptionHelper())
     {
         var response = new JSONObject(str);
         var id = helper.DecryptPurchaseResponse(response, _publicKey);
         if (id != _uniquePurchaseId)
             OnFailure(OuyaErrorCodes.ThrowDuringOnSuccess, "Received purchase ID does not match what we expected to receive", Bundle.Empty);
         _tcs.SetResult(true);
     }
 }
开发者ID:KonajuGames,项目名称:ouya-csharp,代码行数:12,代码来源:PurchaseListener.cs

示例2: OnSuccess

        public void OnSuccess(global::Java.Lang.Object result)
        {
            var str = result.JavaCast<Java.Lang.String>().ToString();
            // Parse gamerUuid into string
            string gamerUuid = string.Empty;
            try
            {
                gamerUuid = str;
                // Cache the gamerUuid to file for later use when the network may not be accessible
                ToCache(gamerUuid);
            }
            catch (Exception e)
            {
                OnFailure(OuyaErrorCodes.ThrowDuringOnSuccess, "Error retrieving gamerUuid: " + e.Message, Bundle.Empty);
            }

            _tcs.SetResult(gamerUuid);
        }
开发者ID:KonajuGames,项目名称:ouya-csharp,代码行数:18,代码来源:GamerUuidListener.cs

示例3: OnSuccess

        public void OnSuccess(global::Java.Lang.Object result)
        {
            var str = result.JavaCast<Java.Lang.String>().ToString();
            // Parse receipts into a list
            IList<Receipt> receipts = null;
            try
            {
                receipts = ReceiptsFromResponse(str);
                // Cache the receipts to file for later use when the network may not be accessible
                ToCache(receipts);
            }
            catch (Exception e)
            {
                OnFailure(OuyaErrorCodes.ThrowDuringOnSuccess, "Error decrypting receipts: " + e.Message, Bundle.Empty);
            }

            _tcs.SetResult(receipts);
        }
开发者ID:pabloescribano,项目名称:ouya-csharp,代码行数:18,代码来源:ReceiptsListener.cs

示例4: OnSuccess

 public void OnSuccess(global::Java.Lang.Object result)
 {
     var str = result.JavaCast<Java.Lang.String>();
     tcs.SetResult(str.ToString());
 }
开发者ID:jfmajor,项目名称:ouya-csharp,代码行数:5,代码来源:StringListener.cs

示例5: OnSuccess

 public void OnSuccess(global::Java.Lang.Object result)
 {
     var str = result.JavaCast<Java.Lang.String>();
     var receipts = _purchaseUtils.CreateReceiptsFromResponse(str.ToString());
     _tcs.SetResult(receipts);
 }
开发者ID:perplexingcabinet,项目名称:ouya-csharp,代码行数:6,代码来源:ReceiptsListener.cs

示例6: OnSuccess

 public void OnSuccess(global::Java.Lang.Object result)
 {
     var str = result.JavaCast<Java.Lang.String>();
     bool purchaseSucceeded = _purchaseUtils.IsPurchaseResponseMatching(str.ToString(), _product, _uniquePurchaseId);
     _tcs.SetResult(purchaseSucceeded);
 }
开发者ID:perplexingcabinet,项目名称:ouya-csharp,代码行数:6,代码来源:PurchaseListener.cs

示例7: OnSuccess

 public void OnSuccess(global::Java.Lang.Object result)
 {
     var list = result.JavaCast<JavaList<Product>>();
     _tcs.SetResult(list);
 }
开发者ID:KonajuGames,项目名称:ouya-csharp,代码行数:5,代码来源:ProductListListener.cs


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