blob: 8c41dbedb2734f5e544de272f0517c24ab581787 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/**
* Namespace: System.Web.UI.Design.WebControls
* Class: BaseDataListComponentEditor
*
* Author: Gaurav Vaish
* Maintainer: mastergaurav AT users DOT sf DOT net
*
* (C) Gaurav Vaish (2002)
*/
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Web.UI.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace System.Web.UI.Design.WebControls
{
public abstract class BaseDataListComponentEditor : WindowsFormsComponentEditor
{
private int initialPage;
public BaseDataListComponentEditor(int initialPage) : base()
{
this.initialPage = initialPage;
}
public override bool EditComponent(ITypeDescriptorContext context,
object obj, IWin32Window parent)
{
IComponent comp = (IComponent) obj;
ISite site = comp.Site;
bool retVal = false;
bool inTemplateMode = false;
if(site != null)
{
IDesignerHost dh = (IDesignerHost)site.GetService(typeof(IDesignerHost));
inTemplateMode = ((TemplatedControlDesigner)dh.GetDesigner(comp)).InTemplateMode;
}
if(inTemplateMode)
{
throw new NotImplementedException();
} else
{
retVal = base.EditComponent(context, obj, parent);
}
return retVal;
}
protected override int GetInitialComponentEditorPageIndex()
{
return initialPage;
}
}
}
|