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
- XmlSchemaSubstitutionGroup.cs
- PermissionRequestEvidence.cs
- OledbConnectionStringbuilder.cs
- VectorAnimationBase.cs
- XamlStyleSerializer.cs
- RandomNumberGenerator.cs
- AddInSegmentDirectoryNotFoundException.cs
- FixedTextPointer.cs
- Pair.cs
- WebException.cs
- UndirectedGraph.cs
- BufferedOutputAsyncStream.cs
- TypeHelper.cs
- CollectionViewGroup.cs
- Token.cs
- ScalarRestriction.cs
- Stack.cs
- DataContract.cs
- IPCCacheManager.cs
- AxHost.cs
- X509SecurityTokenParameters.cs
- ReflectPropertyDescriptor.cs
- Debug.cs
- ParsedAttributeCollection.cs
- BindStream.cs
- ImageKeyConverter.cs
- FacetChecker.cs
- EmptyReadOnlyDictionaryInternal.cs
- GeneralTransformCollection.cs
- PathGeometry.cs
- CodeCompiler.cs
- CustomErrorsSection.cs
- CollectionCodeDomSerializer.cs
- TCPListener.cs
- EventManager.cs
- streamingZipPartStream.cs
- storepermission.cs
- Container.cs
- ThaiBuddhistCalendar.cs
- BitmapFrameDecode.cs
- BasicHttpMessageCredentialType.cs
- MatrixStack.cs
- FrameworkObject.cs
- _HeaderInfoTable.cs
- CatalogZoneAutoFormat.cs
- MetadataHelper.cs
- ByteConverter.cs
- PathSegment.cs
- DbInsertCommandTree.cs
- RandomNumberGenerator.cs
- DataServiceQueryContinuation.cs
- DummyDataSource.cs
- EpmCustomContentWriterNodeData.cs
- Rule.cs
- PrinterUnitConvert.cs
- EndEvent.cs
- KeyGestureValueSerializer.cs
- storepermissionattribute.cs
- Inflater.cs
- AutomationPatternInfo.cs
- DataSetMappper.cs
- MsmqBindingMonitor.cs
- HotSpot.cs
- sqlinternaltransaction.cs
- LinearGradientBrush.cs
- InvalidPrinterException.cs
- SequenceDesigner.cs
- MenuItem.cs
- DbQueryCommandTree.cs
- PropertyItemInternal.cs
- Matrix3DStack.cs
- GAC.cs
- CharacterMetricsDictionary.cs
- TreeWalker.cs
- MergeFailedEvent.cs
- FrameworkElementFactory.cs
- ReferenceEqualityComparer.cs
- PhysicalFontFamily.cs
- Condition.cs
- Transform3DGroup.cs
- BamlLocalizableResourceKey.cs
- PropertyMap.cs
- _UriTypeConverter.cs
- ConversionHelper.cs
- AppSettingsSection.cs
- CustomError.cs
- SymbolTable.cs
- XmlIncludeAttribute.cs
- DateTimeConverter.cs
- FlatButtonAppearance.cs
- MimeMultiPart.cs
- RootProfilePropertySettingsCollection.cs
- SafeNativeMethodsCLR.cs
- HttpWebResponse.cs
- BamlRecords.cs
- ProxyWebPart.cs
- XmlNodeList.cs
- ObjectItemConventionAssemblyLoader.cs
- HybridDictionary.cs
- SelectionProviderWrapper.cs