Ejemplo n.º 1
0
        // -------------------------------------------------------------
        public string          ShowCheckoutWindowAsync(
            PaddleProductID productID,
            CheckoutOptions options,
            bool openInBrowser,
            bool isDialog)
        {
            ScTask        task    = new ScTask();
            PaddleProduct product = Paddle_GetProduct(productID);

            product.Refresh((success) => {
                                #if kUseThreads
                //	do on another thread
                i_threadData.i_currentWindowType = (PaddleWindowType)PaddleWindowType.Checkout;
                i_threadData.i_currentProduct    = product;
                i_threadData.i_checkoutOptions   = options;
                i_threadData.i_openInBrowser     = openInBrowser;
                i_threadData.i_isDialog          = isDialog;
                StartWindowThread();
                                #else
                // do it on this thread
                Paddle.Instance.ShowCheckoutWindowForProduct(product, options, openInBrowser, isDialog);
                                #endif
            });

            return(task.await_result());
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            var productInfo = new PaddleProductConfig {
                ProductName = "Scraptelligence", VendorName = "Scraptelligence"
            };

            Paddle.Configure(paddle_apiKey, paddle_vendorId, paddle_productId, productInfo);
            Paddle.Instance.TransactionCompleteEvent += Paddle_TransactionCompleteEvent;
            Paddle.Instance.TransactionErrorEvent    += Paddle_TransactionErrorEvent;
            Paddle.Instance.TransactionBeginEvent    += Paddle_TransactionBeginEvent;

            PaddleProduct product = PaddleProduct.CreateProduct(paddle_productId);

            product.Refresh((success) =>
            {
                if (success)
                {
                    if (!product.Activated)
                    {
                        Paddle.Instance.ShowProductAccessWindowForProduct(product);
                    }
                }
                else
                {
                    Paddle.Instance.ShowProductAccessWindowForProduct(product);
                }
            });
            // Initialize logger
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Information()
                         .WriteTo.File("logs\\Log.log")
                         .CreateLogger();

            Log.Information("Starting Scraptelligence");
            _showInstagramFollowers      = false;
            myWorker.DoWork             += BackgroundWork;
            myWorker.RunWorkerCompleted += BackgroundCompleted;
            StartButton.Background       = Brushes.DarkSeaGreen;

            string copyrightText = string.Format("Copyright © {0}, Scrapetelligence", DateTime.Now.Year.ToString());

            CopyrightLabel.Content = copyrightText;
        }