예제 #1
0
 public virtual void setTransform(com.codename1.ui.Transform transform)
 {
     this.transform.setTransform(transform);
     if (!transform.isIdentity())
     {
         graphics.Transform = SilverlightImplementation.clamp(((SilverlightImplementation.NativeTransform)transform.getNativeTransform()).m);
     }
     else
     {
         graphics.Transform = Matrix3x2.Identity;
     }
 }
예제 #2
0
        public override void purchase(string idProduct)
        {
            string produto = idProduct;

            payment.PurchaseCallback pc = SilverlightImplementation.getPurchaseCallback();
            SilverlightImplementation.dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() =>
            {
                try
                {
                    ListingInformation listing = await CurrentApp.LoadListingInformationAsync();
                    product1 = listing.ProductListings[produto];
                    PurchaseResults purchaseResults = await CurrentApp.RequestProductPurchaseAsync(produto);

                    switch (purchaseResults.Status)
                    {
                    case ProductPurchaseStatus.Succeeded:
                        GrantFeatureLocally(produto, purchaseResults.TransactionId);
                        FulfillProduct1(produto, purchaseResults.TransactionId);
                        pc.itemPurchased(idProduct);
                        break;

                    case ProductPurchaseStatus.NotFulfilled:
                        if (!IsLocallyFulfilled(produto, purchaseResults.TransactionId))
                        {
                            GrantFeatureLocally(produto, purchaseResults.TransactionId);
                        }
                        FulfillProduct1(produto, purchaseResults.TransactionId);
                        break;

                    case ProductPurchaseStatus.NotPurchased:
                        pc.itemPurchaseError(idProduct, "purchase failed");
                        break;
                    }
                }
                catch (System.Exception e)
                {
                    Debug.WriteLine("Houston, we have a problem: \n\n" + e + "\n\n");
                }
            }).AsTask().ConfigureAwait(false).GetAwaiter().GetResult();
        }
예제 #3
0
 public bool writeBuffOffsetLength(_nArrayAdapter <sbyte> aArr, int aOffset, int aLen)
 {
     return(writeBuffOffsetLength(SilverlightImplementation.toByteArray(aArr.getCSharpArray()), aOffset, aLen));
 }
예제 #4
0
 public bool writeBuf(_nArrayAdapter <sbyte> aArr)
 {
     return(writeBuf(SilverlightImplementation.toByteArray(aArr.getCSharpArray())));
 }
예제 #5
0
 public Object getErrorMessage()
 {
     return(SilverlightImplementation.toJava(lastError == null ? @"" : lastError.Message));
 }
예제 #6
0
 public bool createSocket(java.lang.String host, int port)
 {
     this.host = SilverlightImplementation.toCSharp(host);
     this.port = port;
     return(true);
 }