Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / PanelDesigner.cs / 1 / PanelDesigner.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System.Diagnostics; using System; using System.ComponentModel; using Microsoft.Win32; using System.Web.UI.WebControls; using System.Globalization; ////// /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] [Obsolete("The recommended alternative is PanelContainerDesigner because it uses an EditableDesignerRegion for editing the content. Designer regions allow for better control of the content being edited. http://go.microsoft.com/fwlink/?linkid=14202")] public class PanelDesigner : ReadWriteControlDesigner { ////// Provides design-time support for the ////// web control. /// /// /// protected override void MapPropertyToStyle(string propName, Object varPropValue) { Debug.Assert(propName != null && propName.Length != 0, "Invalid property name passed in!"); Debug.Assert(varPropValue != null, "Invalid property value passed in!"); if (propName == null || varPropValue == null) { return; } if (varPropValue != null) { try { // if (propName.Equals("BackImageUrl")) { string strPropValue = Convert.ToString(varPropValue, CultureInfo.InvariantCulture); if (strPropValue != null) { if (strPropValue.Length != 0) { strPropValue = "url(" + strPropValue + ")"; BehaviorInternal.SetStyleAttribute("backgroundImage", true, strPropValue, true); } } } else if (propName.Equals("HorizontalAlign")) { string strHAlign = String.Empty; if ((HorizontalAlign)varPropValue != HorizontalAlign.NotSet) { strHAlign = Enum.Format(typeof(HorizontalAlign), varPropValue, "G"); } BehaviorInternal.SetStyleAttribute("textAlign", true, strHAlign, true); } else { base.MapPropertyToStyle(propName, varPropValue); } } catch (Exception ex) { Debug.Fail(ex.ToString()); } } } ////// Maps a specified property and value to a specified HTML style. /// ////// /// Notification that is fired upon the designer being attached to the behavior. /// [Obsolete("The recommended alternative is ControlDesigner.Tag. http://go.microsoft.com/fwlink/?linkid=14202")] protected override void OnBehaviorAttached() { base.OnBehaviorAttached(); Panel panel = (Panel)Component; string backImageUrl = panel.BackImageUrl; if (backImageUrl != null) { MapPropertyToStyle("BackImageUrl", backImageUrl); } HorizontalAlign hAlign = panel.HorizontalAlign; if (HorizontalAlign.NotSet != hAlign) { MapPropertyToStyle("HorizontalAlign", hAlign); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventListenerClientSide.cs
- DataMemberFieldEditor.cs
- ListViewInsertEventArgs.cs
- CharUnicodeInfo.cs
- RegistrationServices.cs
- StringAttributeCollection.cs
- HostingEnvironmentSection.cs
- XmlIgnoreAttribute.cs
- FormsAuthenticationModule.cs
- LayoutTable.cs
- BindingMemberInfo.cs
- DataGridDetailsPresenterAutomationPeer.cs
- OverrideMode.cs
- BitmapEffectState.cs
- ArcSegment.cs
- HistoryEventArgs.cs
- Form.cs
- Screen.cs
- TextMarkerSource.cs
- IntegerFacetDescriptionElement.cs
- SharedPersonalizationStateInfo.cs
- EntityCommand.cs
- SqlDataAdapter.cs
- ExpressionsCollectionEditor.cs
- ErrorFormatterPage.cs
- WebServiceReceive.cs
- WindowInteractionStateTracker.cs
- XmlSchemaExternal.cs
- OleAutBinder.cs
- InternalPermissions.cs
- XmlSchemaChoice.cs
- DbModificationClause.cs
- StatusBarPanel.cs
- safex509handles.cs
- BufferModesCollection.cs
- RecognizedAudio.cs
- DataControlButton.cs
- SafeViewOfFileHandle.cs
- XamlFigureLengthSerializer.cs
- ValidationSummary.cs
- CompositionAdorner.cs
- VSWCFServiceContractGenerator.cs
- CallId.cs
- BitVec.cs
- Vector3DCollectionConverter.cs
- GPStream.cs
- ElementMarkupObject.cs
- QilLiteral.cs
- SimpleBitVector32.cs
- DataGridItemEventArgs.cs
- Base64Stream.cs
- XPathScanner.cs
- FlowDocumentReader.cs
- DoubleStorage.cs
- DataGridItemEventArgs.cs
- TreeNodeBinding.cs
- XsdDataContractExporter.cs
- ActivityDesigner.cs
- ping.cs
- ProfileService.cs
- ViewSimplifier.cs
- ObjectQuery_EntitySqlExtensions.cs
- MarkupExtensionParser.cs
- EnumType.cs
- MSAAWinEventWrap.cs
- AdobeCFFWrapper.cs
- WindowsFormsLinkLabel.cs
- SafeRightsManagementHandle.cs
- DatePicker.cs
- MissingMethodException.cs
- MemberDescriptor.cs
- FormViewPagerRow.cs
- NullReferenceException.cs
- ToolStripInSituService.cs
- XmlSchemaAttributeGroup.cs
- QilScopedVisitor.cs
- PrintDialog.cs
- Rect.cs
- GregorianCalendarHelper.cs
- FormatterServices.cs
- CursorConverter.cs
- SortedDictionary.cs
- ClientFormsAuthenticationCredentials.cs
- DesigntimeLicenseContext.cs
- ConfigXmlElement.cs
- PassportAuthenticationEventArgs.cs
- TerminateSequenceResponse.cs
- PageCodeDomTreeGenerator.cs
- TextServicesProperty.cs
- ProfilePropertySettingsCollection.cs
- ParsedAttributeCollection.cs
- TextInfo.cs
- NamespaceExpr.cs
- ExpressionBuilderCollection.cs
- AppearanceEditorPart.cs
- ToolStripOverflowButton.cs
- SecurityDocument.cs
- Win32SafeHandles.cs
- ParseElementCollection.cs
- SecurityBindingElementImporter.cs