一托就行了Timer
代码
1using System;
2using System.ComponentModel;
3using System.ComponentModel.Design;
4using System.Web.UI;
5using PowerAsp.NET.Comtrols;
6
7namespace PowerAsp.NET.Designer
8{
9 /**//// <summary>
10 /// WebTimer2Designer 的摘要说明。
11 /// </summary>
12 public class WebTimer2Designer:ComponentDesigner
13 {
14 public WebTimer2Designer()
15 {
16 }
17 public override void Initialize(IComponent component)
18 {
19 base.Initialize (component);//这里好玩,,一定要先调用,要不把无效指针,不明白为啥。
20
21 IContainer container = Component.Site.Container;
22 foreach(IComponent comp in container.Components)
23 {
24 if(comp is Page)
25 {
26 ((WebTimer2)component)._Page = (Page)comp;
27 }
28 }
29 }
30
31 }
32}
33给原有添加设计器
34 [ToolboxItemFilter("System.Web.UI",ToolboxItemFilterType.Require),
35 Designer(typeof(PowerAsp.NET.Designer.WebTimer2Designer))
36 ]
37 public class WebTimer2:Component
38 {
39隐藏Page属性
40[Browsable(false),
41 DefaultValue(null)]
42 public Page _Page
1using System;
2using System.ComponentModel;
3using System.ComponentModel.Design;
4using System.Web.UI;
5using PowerAsp.NET.Comtrols;
6
7namespace PowerAsp.NET.Designer
8{
9 /**//// <summary>
10 /// WebTimer2Designer 的摘要说明。
11 /// </summary>
12 public class WebTimer2Designer:ComponentDesigner
13 {
14 public WebTimer2Designer()
15 {
16 }
17 public override void Initialize(IComponent component)
18 {
19 base.Initialize (component);//这里好玩,,一定要先调用,要不把无效指针,不明白为啥。
20
21 IContainer container = Component.Site.Container;
22 foreach(IComponent comp in container.Components)
23 {
24 if(comp is Page)
25 {
26 ((WebTimer2)component)._Page = (Page)comp;
27 }
28 }
29 }
30
31 }
32}
33给原有添加设计器
34 [ToolboxItemFilter("System.Web.UI",ToolboxItemFilterType.Require),
35 Designer(typeof(PowerAsp.NET.Designer.WebTimer2Designer))
36 ]
37 public class WebTimer2:Component
38 {
39隐藏Page属性
40[Browsable(false),
41 DefaultValue(null)]
42 public Page _Page