Beispiel #1
0
        public CustomDialogResults ShowYesNo(string message, CustomDialogIcons icon)
        {
            if (ShowYesNoResponders.Count == 0)
            {
                throw new ApplicationException("TestMessageBoxService ShowYesNo method expects a Func<CustomDialogResults> callback \r\ndelegate to be enqueued for each Show call");
            }

            ShowYesNoRequests.Add(new MessageBoxRequest {
                Message = message, Icon = icon
            });

            return(ShowYesNoResponders.Dequeue()());
        }
 /// <summary>
 /// Returns the next Dequeue ShowYesNo response expected. See the tests for
 /// the Func callback expected values
 /// </summary>
 /// <param name="message">The message to be displayed.</param>
 /// <param name="icon">The icon to be displayed.</param>
 /// <returns>User selection.</returns>
 public CustomDialogResults ShowYesNo(string message, CustomDialogIcons icon)
 {
     if (ShowYesNoResponders.Count == 0)
     {
         throw new ApplicationException(
                   "TestMessageBoxService ShowYesNo method expects a Func<CustomDialogResults> callback \r\n" +
                   "delegate to be enqueued for each Show call");
     }
     else
     {
         Func <CustomDialogResults> responder = ShowYesNoResponders.Dequeue();
         return(responder());
     }
 }