PDA

Click to See Complete Forum and Search --> : ReadWriteControlDesigner


Magiaus
May 22nd, 2004, 05:14 AM
Anyone know how to use this thing?

-----------------------------------------------------

ReadWriteControlDesigner Class (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuidesignreadwritecontroldesignerclasstopic.asp)

Extends design-time behavior for read/write server controls.

For a list of all members of this type, see
ReadWriteControlDesigner Members. (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuidesignreadwritecontroldesignermemberstopic.asp)

Public Class ReadWriteControlDesigner
Inherits ControlDesigner

public class ReadWriteControlDesigner : ControlDesigner

Thread Safety
Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks
This control designer provides the ability to drop controls onto the control for this designer.

Notes to Implementers:Implementors of designers who would like their control to support adding child controls to it should use ReadWriteControlDesigner. If you do not want your control to support child controls, use a designer derived from ControlDesigner.

Requirements
Namespace: System.Web.UI.Design

Platforms: Windows 2000, Windows XP Professional, Windows .NET Server family

Assembly: System.Design (in System.Design.dll

Magiaus
May 22nd, 2004, 05:16 AM
[Visual Basic]
' Override the MapPropertyToStyle method to set the
' Panel.Wrap property to the NoWrap HTML attribute.
Overrides Protected Sub MapPropertyToStyle(propName As String, varPropValue As Object)
' Display messages when debugging.
Debug.Assert(Not (propName = Nothing Or propName.Length <> 0), "Invalid property name passed in.")
Debug.Assert(Not (varPropValue = Nothing), "Invalid property value passed in.")

' If the parameters passed to the method are null,
' return nothing.
If ((propName Is Nothing) And (varPropValue Is Nothing)) Then
Return
End If

' If the second parameter is not a null
' value, check whether the property name is Wrap.
If Not (varPropValue Is Nothing) Then
Try
' If property name is wrap, convert
' it to the HTML NoWrap attribute.
If (propName.Equals("Wrap")) Then
Dim strValue As String = String.Empty

If (CType(varPropValue, Boolean)) Then
Behavior.SetStyleAttribute("NoWrap", True, strValue, True)
End If
Else
MyBase.MapPropertyToStyle(propName, varPropValue)
End If
Catch ex As Exception
Debug.Fail(ex.ToString())
End Try
End If
End Sub 'MapPropertyToStyle