Code:
/ FX-1434 / FX-1434 / 1.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
- WorkflowIdleBehavior.cs
- ObjectQueryProvider.cs
- DataPointer.cs
- CharacterBufferReference.cs
- XmlObjectSerializerReadContext.cs
- DescendentsWalker.cs
- ButtonFlatAdapter.cs
- LocalFileSettingsProvider.cs
- ClientCultureInfo.cs
- XsltArgumentList.cs
- DataKeyCollection.cs
- XmlArrayItemAttributes.cs
- SymmetricKeyWrap.cs
- FileLoadException.cs
- MarshalByRefObject.cs
- ConfigurationStrings.cs
- SignatureDescription.cs
- OleDbInfoMessageEvent.cs
- TableRowGroup.cs
- DataAccessor.cs
- ReversePositionQuery.cs
- DockPattern.cs
- BaseResourcesBuildProvider.cs
- SqlProvider.cs
- _WinHttpWebProxyDataBuilder.cs
- AuthenticateEventArgs.cs
- SqlClientWrapperSmiStreamChars.cs
- Int64Animation.cs
- XPathNodeHelper.cs
- PreProcessor.cs
- HitTestResult.cs
- TextPattern.cs
- ValidationSummary.cs
- BatchParser.cs
- PathNode.cs
- FlowPosition.cs
- UnknownBitmapEncoder.cs
- DataGridTablesFactory.cs
- SessionSwitchEventArgs.cs
- URLIdentityPermission.cs
- TextBox.cs
- WsatExtendedInformation.cs
- SoapReflectionImporter.cs
- BuildProvider.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- List.cs
- PreProcessor.cs
- WebControlAdapter.cs
- StylusButton.cs
- SerializationObjectManager.cs
- XAMLParseException.cs
- WorkItem.cs
- DependencyObjectProvider.cs
- XmlProcessingInstruction.cs
- SqlProviderManifest.cs
- CommandBindingCollection.cs
- MasterPageBuildProvider.cs
- BrowserDefinitionCollection.cs
- DataGridCellItemAutomationPeer.cs
- XmlFormatExtensionPrefixAttribute.cs
- AsynchronousChannelMergeEnumerator.cs
- OleDbParameterCollection.cs
- TextParagraphView.cs
- XmlSchemaAnnotation.cs
- IIS7UserPrincipal.cs
- WinCategoryAttribute.cs
- WebEventCodes.cs
- ApplicationServicesHostFactory.cs
- BulletChrome.cs
- GenericAuthenticationEventArgs.cs
- XmlSchemaComplexType.cs
- EntityDataSourceReferenceGroup.cs
- TemplateInstanceAttribute.cs
- DodSequenceMerge.cs
- CacheMemory.cs
- DbgUtil.cs
- SevenBitStream.cs
- NameValuePermission.cs
- EtwTrackingBehaviorElement.cs
- Identity.cs
- PackageDigitalSignature.cs
- SqlConnectionPoolProviderInfo.cs
- SyndicationFeedFormatter.cs
- safemediahandle.cs
- PrimaryKeyTypeConverter.cs
- HitTestWithPointDrawingContextWalker.cs
- SBCSCodePageEncoding.cs
- UInt32.cs
- SizeAnimationClockResource.cs
- EventPrivateKey.cs
- BlobPersonalizationState.cs
- XslCompiledTransform.cs
- Dictionary.cs
- StorageScalarPropertyMapping.cs
- HttpHandlersSection.cs
- DataGridHeaderBorder.cs
- BaseUriHelper.cs
- AtomPub10ServiceDocumentFormatter.cs
- WebRequestModulesSection.cs
- DropDownList.cs