Beispiel #1
0
		/// <summary>
		/// Shows a message box with the given parameters.
		/// </summary>
		/// <param name="scene"> A <see cref="Scene"/> to show it on. </param>
		/// <param name="icon"> Which <see cref="MessageBoxIcon"/> to show next to the message. </param>
		/// <param name="message"> The bosy of the message. </param>
		/// <param name="responses"> The possible <see cref="MessageBoxResponse"/>. A button will be made for each one. </param>
		/// <returns> The <see cref="MessageBox"/> that was created. </returns>
		public static MessageBox Show(Scene scene, MessageBoxIcon icon, 
			string message, MessageBoxResponse responses)
		{
			var box = new MessageBox() {
				Icon = icon
			};
			
			// add the buttons
			foreach (var val in Enum.GetValues(typeof(MessageBoxResponse)))
			{
				var response = (MessageBoxResponse)val;
				if ((responses & response) == response)
				{
					box.AddButton(response);
				}
			}
			
			// set the message and icon
			box.Message = message;
			
			// show the box
			scene.ShowModal(box);
			
			return box;
		}