New test.
[mono.git] / mcs / class / System.Web / System.Web.UI / DesignTimeParseData.cs
1 //
2 // System.Web.DesignTimeParseData class
3 //
4 // 
5 // Author:
6 //      Miguel de Icaza (miguel@novell.com)
7 //
8
9 //
10 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
11 //
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
19 // 
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
22 // 
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 //
31
32 using System.Collections;
33 using System.ComponentModel.Design;
34 using System.Security.Permissions;
35
36 namespace System.Web.UI {
37
38         // CAS - no InheritanceDemand here as the class is sealed
39         [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
40         public sealed class DesignTimeParseData {
41                 EventHandler db_handler;
42                 string text;
43                 IDesignerHost host;
44                 string durl;
45 #if NET_2_0
46                 string filter;
47                 bool theme;
48                 ICollection collection;
49 #endif
50                 
51                 public DesignTimeParseData (IDesignerHost designerHost, string parseText)
52                 {
53                         host = designerHost;
54                         text = parseText;
55                 }
56 #if NET_2_0
57                 public DesignTimeParseData (IDesignerHost designerHost, string parseText, string filter)
58                         : this (designerHost, parseText)
59                 {
60                         this.filter = filter;
61                 }
62 #endif
63
64                 public EventHandler DataBindingHandler {
65                         get {
66                                 return db_handler;
67                         }
68
69                         set {
70                                 db_handler = value;
71                         }
72                 }
73
74                 public IDesignerHost DesignerHost {
75                         get {
76                                 return host;
77                         }
78                 }
79
80                 public string DocumentUrl {
81                         get {
82                                 return durl;
83                         }
84
85                         set {
86                                 durl = value;
87                         }
88                 }
89
90                 public string ParseText {
91                         get {
92                                 return text;
93                         }
94                 }
95 #if NET_2_0
96                 public string Filter {
97                         get { return filter; }
98                 }
99
100                 public bool ShouldApplyTheme {
101                         get { return theme; }
102                         set { theme = value; }
103                 }
104
105                 // FIXME: there's probably a way to set this somewhere...
106                 public ICollection UserControlRegisterEntries {
107                         get { return collection; }
108                 }
109 #endif
110         }
111 }