Wed Feb 24 15:47:16 CET 2010 Paolo Molaro <lupus@ximian.com>
[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-2010 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                 string filter;
46                 bool theme;
47                 ICollection collection;
48                 
49                 public DesignTimeParseData (IDesignerHost designerHost, string parseText)
50                 {
51                         host = designerHost;
52                         text = parseText;
53                 }
54
55                 public DesignTimeParseData (IDesignerHost designerHost, string parseText, string filter)
56                         : this (designerHost, parseText)
57                 {
58                         this.filter = filter;
59                 }
60
61                 internal void SetCollection (ICollection collection)
62                 {
63                         this.collection = collection;
64                 }
65
66                 public EventHandler DataBindingHandler {
67                         get {
68                                 return db_handler;
69                         }
70
71                         set {
72                                 db_handler = value;
73                         }
74                 }
75
76                 public IDesignerHost DesignerHost {
77                         get {
78                                 return host;
79                         }
80                 }
81
82                 public string DocumentUrl {
83                         get {
84                                 return durl;
85                         }
86
87                         set {
88                                 durl = value;
89                         }
90                 }
91
92                 public string ParseText {
93                         get {
94                                 return text;
95                         }
96                 }
97
98                 public string Filter {
99                         get { return filter; }
100                 }
101
102                 public bool ShouldApplyTheme {
103                         get { return theme; }
104                         set { theme = value; }
105                 }
106
107                 // FIXME: there's probably a way to set this somewhere...
108                 public ICollection UserControlRegisterEntries {
109                         get { return collection; }
110                 }
111         }
112 }