示例#1
0
        internal static bool GetConsumableBalance(MainWindow window, string itemid)
        {
            main = window;
            consumableBalanceCallback = new ConsumableBalanceCallback(GetSonsumableBalanceCallback);
            var ret = GetConsumableBalanceRemaining(itemid, consumableBalanceCallback);

            return(ret);
        }
示例#2
0
        static void GetSonsumableBalanceCallback(bool result, uint quantity, string msg)
        {
            main.Dispatcher.Invoke(() =>
            {
                main.Logs("=====Get Consumable Balance================");
                if (!result)
                {
                    main.Logs("Error");
                }
                main.Logs(msg);
                main.Logs("Remaining=" + quantity.ToString());
            });
            // Release delegate.
            // デリゲートの解放
            var ds = consumableBalanceCallback.GetInvocationList();

            foreach (var d in ds)
            {
                consumableBalanceCallback -= (ConsumableBalanceCallback)d;
            }
        }
示例#3
0
 static extern bool GetConsumableBalanceRemaining([MarshalAs(UnmanagedType.LPWStr)] string itemId, ConsumableBalanceCallback callback);