3 // Rafael Mizrahi <rafim@mainsoft.com>
4 // Erez Lotan <erezl@mainsoft.com>
5 // Vladimir Krasnov <vladimirk@mainsoft.com>
8 // Copyright (c) 2002-2005 Mainsoft Corporation.
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 using System.Web.UI.WebControls;
35 using System.Web.UI.HtmlControls;
37 namespace GHTTests.System_Web_dll.System_Web_UI_WebControls
39 public class WebControl_ApplyStyle_S
42 #region Web Form Designer generated code
43 override protected void OnInit(EventArgs e)
46 // CODEGEN: This call is required by the ASP.NET Web Form Designer.
48 InitializeComponent();
53 /// Required method for Designer support - do not modify
54 /// the contents of this method with the code editor.
56 private void InitializeComponent()
58 this.Load += new System.EventHandler(this.Page_Load);
62 #region "Data members"
63 private Style m_newStyle;
64 private Style m_oldStyle;
65 private Style m_blankStyle;
68 private void Page_Load(object sender, System.EventArgs e)
70 HtmlForm frm = (HtmlForm)FindControl("Form1");
77 GHTSubTestBegin("Styles initialization");
78 GHTSubTestUnexpectedExceptionCaught(ex);
82 foreach (Type currentType in TypesToTest)
84 GHTHeader(currentType.ToString());
90 private void Test(Type ctrlType)
94 this.GHTSubTestBegin(ctrlType, "Apply a new style:");
95 this.TestedControl.ApplyStyle(this.m_newStyle);
97 catch (Exception exception3)
99 // ProjectData.SetProjectError(exception3);
100 Exception exception1 = exception3;
101 this.GHTSubTestUnexpectedExceptionCaught(exception1);
102 // ProjectData.ClearProjectError();
104 this.GHTSubTestEnd();
107 this.GHTSubTestBegin(ctrlType, "Apply a blank style:");
108 this.TestedControl.ApplyStyle(this.m_oldStyle);
109 this.TestedControl.ApplyStyle(this.m_blankStyle);
111 catch (Exception exception4)
113 // ProjectData.SetProjectError(exception4);
114 Exception exception2 = exception4;
115 this.GHTSubTestUnexpectedExceptionCaught(exception2);
116 // ProjectData.ClearProjectError();
118 this.GHTSubTestEnd();
122 private void InitStyles()
124 this.m_blankStyle = new Style();
125 this.m_oldStyle = new Style();
126 Style style2 = this.m_oldStyle;
127 style2.BackColor = Color.Wheat;
128 style2.BorderColor = Color.DarkGreen;
129 style2.BorderStyle = BorderStyle.Double;
130 Unit unit2 = new Unit(5);
131 style2.BorderWidth = unit2;
132 style2.ForeColor = Color.DarkMagenta;
133 unit2 = new Unit(60);
134 style2.Height = unit2;
135 unit2 = new Unit(60);
136 style2.Width = unit2;
137 FontInfo info2 = style2.Font;
139 info2.Italic = false;
140 info2.Name = "Times New Roman";
141 info2.Overline = false;
142 FontUnit unit1 = new FontUnit(FontSize.Small);
144 info2.Strikeout = false;
145 info2.Underline = false;
148 this.m_newStyle = new Style();
149 Style style1 = this.m_newStyle;
150 style1.BackColor = Color.AliceBlue;
151 style1.BorderColor = Color.Red;
152 style1.BorderStyle = BorderStyle.Dashed;
154 style1.BorderWidth = unit2;
155 style1.ForeColor = Color.RoyalBlue;
156 unit2 = new Unit(40);
157 style1.Height = unit2;
158 unit2 = new Unit(40);
159 style1.Width = unit2;
160 FontInfo info1 = style1.Font;
163 info1.Name = "Arial";
164 info1.Overline = true;
165 unit1 = new FontUnit(FontSize.Large);
167 info1.Strikeout = true;
168 info1.Underline = true;