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
- ObjectAssociationEndMapping.cs
- BulletedListEventArgs.cs
- NetworkInterface.cs
- ContainerParagraph.cs
- validation.cs
- RegexCompiler.cs
- PerformanceCounterLib.cs
- TableCell.cs
- RawContentTypeMapper.cs
- HostExecutionContextManager.cs
- DesignerWithHeader.cs
- COM2PropertyDescriptor.cs
- TemplateControlCodeDomTreeGenerator.cs
- PolyQuadraticBezierSegment.cs
- LineSegment.cs
- WindowsFormsSynchronizationContext.cs
- SystemIcmpV4Statistics.cs
- SoapTransportImporter.cs
- BindingSource.cs
- IndicCharClassifier.cs
- OpenTypeMethods.cs
- ASCIIEncoding.cs
- LogStore.cs
- TimeZone.cs
- UnescapedXmlDiagnosticData.cs
- ReflectTypeDescriptionProvider.cs
- ListSourceHelper.cs
- Handle.cs
- SHA1CryptoServiceProvider.cs
- HuffModule.cs
- XmlCustomFormatter.cs
- InkCanvasSelectionAdorner.cs
- XmlDataCollection.cs
- DocumentViewerHelper.cs
- XPathQilFactory.cs
- AffineTransform3D.cs
- SubpageParagraph.cs
- RijndaelManaged.cs
- CompiledIdentityConstraint.cs
- TimeStampChecker.cs
- CookielessHelper.cs
- TransactionFormatter.cs
- StaticContext.cs
- InvokePatternIdentifiers.cs
- SqlClientWrapperSmiStreamChars.cs
- StatusBarPanel.cs
- ProxyGenerationError.cs
- PeerNameResolver.cs
- Point3D.cs
- ActivityStatusChangeEventArgs.cs
- DiffuseMaterial.cs
- SafeCoTaskMem.cs
- SqlConnectionPoolProviderInfo.cs
- WeakReference.cs
- TaskScheduler.cs
- ToolStripContentPanelRenderEventArgs.cs
- Message.cs
- MouseGestureValueSerializer.cs
- SqlExpander.cs
- ResourceWriter.cs
- TableLayoutPanelCellPosition.cs
- PixelFormat.cs
- DataProtection.cs
- TextTreeFixupNode.cs
- transactioncontext.cs
- XmlComment.cs
- SerialPinChanges.cs
- HiddenField.cs
- ImportDesigner.xaml.cs
- PointLightBase.cs
- Form.cs
- BaseCodePageEncoding.cs
- WebBrowserDocumentCompletedEventHandler.cs
- DataSvcMapFileSerializer.cs
- ListViewItemMouseHoverEvent.cs
- StringDictionaryWithComparer.cs
- StrongNamePublicKeyBlob.cs
- DtrList.cs
- CodeExporter.cs
- PointKeyFrameCollection.cs
- ProxyManager.cs
- CompiledXpathExpr.cs
- MdImport.cs
- MsmqTransportBindingElement.cs
- ProfileSection.cs
- HScrollProperties.cs
- PerfCounterSection.cs
- SQLString.cs
- LinkGrep.cs
- DataContract.cs
- AddInProcess.cs
- TextSelection.cs
- UrlPropertyAttribute.cs
- OracleBFile.cs
- UnhandledExceptionEventArgs.cs
- DesignTimeTemplateParser.cs
- ControlDesignerState.cs
- LinqDataSourceStatusEventArgs.cs
- DWriteFactory.cs
- ProgramNode.cs