-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
EditorPartDesigner.xml
157 lines (144 loc) · 11.4 KB
/
EditorPartDesigner.xml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<Type Name="EditorPartDesigner" FullName="System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner">
<TypeSignature Language="C#" Value="public class EditorPartDesigner : System.Web.UI.Design.WebControls.WebParts.PartDesigner" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit EditorPartDesigner extends System.Web.UI.Design.WebControls.WebParts.PartDesigner" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner" />
<TypeSignature Language="VB.NET" Value="Public Class EditorPartDesigner
Inherits PartDesigner" />
<TypeSignature Language="F#" Value="type EditorPartDesigner = class
 inherit PartDesigner" />
<TypeSignature Language="C++ CLI" Value="public ref class EditorPartDesigner : System::Web::UI::Design::WebControls::WebParts::PartDesigner" />
<AssemblyInfo>
<AssemblyName>System.Design</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Web.UI.Design.WebControls.WebParts.PartDesigner</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides design-time support for <see cref="T:System.Web.UI.WebControls.WebParts.EditorPart" /> controls.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner> is a public implementation of the <xref:System.Web.UI.Design.WebControls.WebParts.PartDesigner> base class for the purpose of rendering <xref:System.Web.UI.WebControls.WebParts.EditorPart> controls at design time. It adds the capability of carrying zone information from the associated control into design view, but does not otherwise change the functionality of the parent control.
As with other control designers, you can change the design-time rendering of custom <xref:System.Web.UI.WebControls.WebParts.EditorPart> controls by inheriting from <xref:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner> and overriding the <xref:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner.GetDesignTimeHtml%2A> method. If you want to override the <xref:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner.CreateViewControl%2A> method, be sure to include the base implementation so as to retain zone information.
## Examples
The following code example creates a simple custom <xref:System.Web.UI.WebControls.WebParts.EditorPart> control that allows the user to change the <xref:System.Web.UI.WebControls.WebControl.ToolTip%2A> property of the target control. The associated <xref:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner> validates the control and replaces the user input text box at design time with a label explaining that it is hidden.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/WebPartsDesigners_EditorPartDesigner_Overview/CS/SecretEditorPart.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/WebPartsDesigners_EditorPartDesigner_Overview/vb/secreteditorpart.vb" id="Snippet1":::
In order for the custom control to render, the page must have a <xref:System.Web.UI.WebControls.WebParts.WebPartManager> control, an <xref:System.Web.UI.WebControls.WebParts.EditorZone> with a <xref:System.Web.UI.WebControls.WebParts.EditorZone.ZoneTemplate%2A> for the control to reside in, and a <xref:System.Web.UI.WebControls.WebParts.WebPartZone> containing a control for the custom <xref:System.Web.UI.WebControls.WebParts.EditorPart> to act on, as shown in the following code example.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/WebPartsDesigners_EditorPartDesigner_Overview/CS/Default.aspx" id="Snippet2":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/WebPartsDesigners_EditorPartDesigner_Overview/vb/default.aspx" id="Snippet2":::
For the <xref:System.Web.UI.WebControls.WebParts.EditorPart> to be usable at run time, edit mode must be enabled on the page. The following code example demonstrates how to do so with a code-behind file.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/WebPartsDesigners_EditorPartDesigner_Overview/CS/Default.aspx.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/WebPartsDesigners_EditorPartDesigner_Overview/vb/default.aspx.vb" id="Snippet3":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.Design.ControlDesigner" />
<altmember cref="T:System.Web.UI.WebControls.WebParts.EditorPart" />
<altmember cref="T:System.Web.UI.Design.WebControls.WebParts.WebPartDesigner" />
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/e0s9t4ck(v=vs.100)">ASP.NET Web Parts Controls</related>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/wxh45wzs(v=vs.100)">ASP.NET Control Designers Overview</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public EditorPartDesigner ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 EditorPartDesigner();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Design</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateViewControl">
<MemberSignature Language="C#" Value="protected override System.Web.UI.Control CreateViewControl ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Web.UI.Control CreateViewControl() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner.CreateViewControl" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateViewControl () As Control" />
<MemberSignature Language="F#" Value="override this.CreateViewControl : unit -> System.Web.UI.Control" Usage="editorPartDesigner.CreateViewControl " />
<MemberSignature Language="C++ CLI" Value="protected:
 override System::Web::UI::Control ^ CreateViewControl();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Design</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.Control</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a copy of the associated <see cref="T:System.Web.UI.WebControls.WebParts.EditorPart" /> control to render at design time.</summary>
<returns>A copy of the associated <see cref="T:System.Web.UI.WebControls.WebParts.EditorPart" /> control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is overridden to copy zone information to the view control.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetDesignTimeHtml">
<MemberSignature Language="C#" Value="public override string GetDesignTimeHtml ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string GetDesignTimeHtml() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner.GetDesignTimeHtml" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetDesignTimeHtml () As String" />
<MemberSignature Language="F#" Value="override this.GetDesignTimeHtml : unit -> string" Usage="editorPartDesigner.GetDesignTimeHtml " />
<MemberSignature Language="C++ CLI" Value="public:
 override System::String ^ GetDesignTimeHtml();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Design</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Verifies that the control resides in a zone of type <see cref="T:System.Web.UI.WebControls.WebParts.EditorZoneBase" />, and then gets the markup that is used to represent the control at design time.</summary>
<returns>The markup that is used to represent the control at design time, or error markup if the control does not reside in an <see cref="T:System.Web.UI.WebControls.WebParts.EditorZoneBase" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Initialize">
<MemberSignature Language="C#" Value="public override void Initialize (System.ComponentModel.IComponent component);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Initialize(class System.ComponentModel.IComponent component) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner.Initialize(System.ComponentModel.IComponent)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub Initialize (component As IComponent)" />
<MemberSignature Language="F#" Value="override this.Initialize : System.ComponentModel.IComponent -> unit" Usage="editorPartDesigner.Initialize component" />
<MemberSignature Language="C++ CLI" Value="public:
 override void Initialize(System::ComponentModel::IComponent ^ component);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Design</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="component" Type="System.ComponentModel.IComponent" />
</Parameters>
<Docs>
<param name="component">The <see cref="T:System.Web.UI.WebControls.WebParts.EditorPart" /> control associated with the designer.</param>
<summary>Binds the designer to the associated <see cref="T:System.Web.UI.WebControls.WebParts.EditorPart" /> control.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>