Beispiel #1
0
 public MessageBoxPack(MessageBoxPack mbp)
 {
     this.messageBoxText = mbp.messageBoxText;
     this.caption        = mbp.caption;
     this.button         = mbp.button;
     this.icon           = mbp.icon;
 }
Beispiel #2
0
        /// <summary>
        /// キューに送られたとおりに非同期でメッセージボックスを表示します
        /// </summary>
        /// <param name="mbp">パック済みの内容</param>
        public static void AddMessageBoxQueue(MessageBoxPack mbp)
        {
            MessageBoxQueue.Enqueue(mbp);

            if (GetLockState() == false)
            {
                ShowMessageBoxAsync();
            }
        }
Beispiel #3
0
        private static async void ShowMessageBoxAsync()
        {
            await Task.Run(() =>
            {
                Lock();

                while (true)
                {
                    var mbp    = new MessageBoxPack(MessageBoxQueue.Dequeue());
                    var result = System.Windows.MessageBox.Show(mbp.messageBoxText, mbp.caption, mbp.button, mbp.icon);

                    if (MessageBoxQueue.Count == 0)
                    {
                        break;
                    }
                }

                Unlock();
            });
        }