2010年12月30日 星期四

Enum範例

public class TextMessage
{
 public enum Buttons
 {
  AbortRetryIgnore,
  OK,
  OKCancel,
  RetryCancel,
  YesNo,
  YesNoCancel
 }

 public enum Icon
 {
  Asterisk,
  Error,
  Exclamation,
  Hand,
  Information,
  None,
  Question,
  Stop,
  Warning
 }

}

public class MessageEventArgs : EventArgs
{
 public readonly string Message;
 public readonly string Caption;
 public readonly TextMessage.Buttons Buttons;
 public readonly TextMessage.Icon Icon;

 public MessageEventArgs(string text, string caption, TextMessage .Buttons buttons, TextMessage .Icon icon)
 {
  Message = text;
  Caption = caption;
  Buttons = buttons;
  Icon = icon;
 }
}


沒有留言: