Wed Feb 24 15:47:16 CET 2010 Paolo Molaro <lupus@ximian.com>
[mono.git] / mcs / class / System.Web / Test / mainsoft / NunitWebResources / App_Code / EnumConverterControl.cs
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Web;
5 using System.Web.UI.WebControls;
6
7 namespace MonoTests.Controls
8 {
9         [Flags]
10         public enum EnumConverterTestValues
11         {
12                 FlagOne = 0x01,
13                 FlagTwo = 0x02
14         }
15
16         public class EnumConverterTestValuesConverter : EnumConverter
17         {
18                 public EnumConverterTestValuesConverter (Type type)
19                         : base (type)
20                 { }
21         }
22
23         public class EnumConverterTextBox : TextBox
24         {
25                 EnumConverterTestValues values;
26
27                 [TypeConverter (typeof (EnumConverterTestValuesConverter))]
28                 public EnumConverterTestValues Values {
29                         get { return values; }
30                         set { values = value; }
31                 }
32
33                 public EnumConverterTextBox ()
34                 {
35                 }
36
37                 protected override void OnInit (EventArgs e)
38                 {
39                         base.OnInit (e);
40                         Text = values.ToString ();
41                 }
42         }
43 }