using System;
using System.Collections.Generic;

namespace OpenSEMI.ClientBase
{
	public class MessageDialog : DialogViewModel<DialogButton>
	{
		private string m_text;

		private List<ButtonControl> m_buttons = new List<ButtonControl>();

		private DialogType m_DialogType = DialogType.INFO;

		public string Text
		{
			get
			{
				return m_text;
			}
			set
			{
				m_text = value;
				NotifyOfPropertyChange("Text");
			}
		}

		public DialogButton DialogButton
		{
			set
			{
				m_buttons.Clear();
				foreach (int value2 in Enum.GetValues(typeof(DialogButton)))
				{
					DialogButton dialogButton = (DialogButton)value2;
					if (value.HasFlag(dialogButton))
					{
						ButtonControl buttonControl = new ButtonControl();
						buttonControl.Name = dialogButton.ToString();
						if (dialogButton == DialogButton.OK || dialogButton == DialogButton.Yes)
						{
							buttonControl.IsDefault = true;
						}
						else
						{
							buttonControl.IsDefault = false;
						}
						if (dialogButton == DialogButton.Cancel || dialogButton == DialogButton.No)
						{
							buttonControl.IsCancel = true;
						}
						else
						{
							buttonControl.IsCancel = false;
						}
						m_buttons.Add(buttonControl);
					}
				}
			}
		}

		public List<ButtonControl> Buttons => m_buttons;

		public DialogType DialogType
		{
			get
			{
				return m_DialogType;
			}
			set
			{
				m_DialogType = value;
				NotifyOfPropertyChange("DialogType");
			}
		}
	}
}