Exemplo n.º 1
0
        internal static bool ReportFulfillment(MainWindow window, string itemid, int quantity = 1)
        {
            main             = window;
            purchaseCallback = new PurchaseCallback(ReportFulFillmentCallback);
            var ret = ReportConsumableFulfillment(itemid, (uint)quantity, purchaseCallback);

            return(ret);
        }
Exemplo n.º 2
0
        internal static bool AddonPurchase(MainWindow window, string itemId)
        {
            main = window;

            purchaseCallback = new PurchaseCallback(AddonPurchaseCallback);
            var ret = RequestPurchaseAddon(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle, itemId, purchaseCallback);

            return(ret);
        }
Exemplo n.º 3
0
        internal static bool AppPurchase(MainWindow window)
        {
            main = window;

            purchaseCallback = new PurchaseCallback(AppPurchaseCallback);
            var ret = RequestPurchaseApp(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle, purchaseCallback);

            return(ret);
        }
Exemplo n.º 4
0
        static void AddonPurchaseCallback(bool result, string msg)
        {
            main.Dispatcher.Invoke(() =>
            {
                main.Logs("=====Add-On Purchase================");
                if (!result)
                {
                    main.Logs("Error");
                }
                main.Logs(msg);
            });
            // Release delegate.
            // デリゲートの解放
            var ds = purchaseCallback.GetInvocationList();

            foreach (var d in ds)
            {
                purchaseCallback -= (PurchaseCallback)d;
            }
        }
Exemplo n.º 5
0
 static extern bool ReportConsumableFulfillment([MarshalAs(UnmanagedType.LPWStr)] string itemId, uint quantity, PurchaseCallback callback);
Exemplo n.º 6
0
 static extern bool RequestPurchaseAddon(IntPtr hwnd, [MarshalAs(UnmanagedType.LPWStr)] string itemId, PurchaseCallback callback);
Exemplo n.º 7
0
 static extern bool RequestPurchaseApp(IntPtr hwnd, PurchaseCallback callback);