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
- UrlPath.cs
- TextRangeBase.cs
- MimeParameterWriter.cs
- RegexBoyerMoore.cs
- ActivityValidator.cs
- TimerElapsedEvenArgs.cs
- HostSecurityManager.cs
- SplineKeyFrames.cs
- CredentialSelector.cs
- EventToken.cs
- ReflectionUtil.cs
- PassportAuthenticationModule.cs
- PlaceHolder.cs
- TransformConverter.cs
- ConditionalAttribute.cs
- DeobfuscatingStream.cs
- SQLInt32.cs
- WebScriptServiceHost.cs
- X509RecipientCertificateServiceElement.cs
- NegotiateStream.cs
- XmlSchemaGroupRef.cs
- CheckBox.cs
- MappingException.cs
- TextTreeTextElementNode.cs
- InstalledFontCollection.cs
- UnsafeNativeMethods.cs
- ListInitExpression.cs
- ParamArrayAttribute.cs
- TrackingMemoryStream.cs
- SimpleBitVector32.cs
- VersionPair.cs
- RowBinding.cs
- CheckBoxBaseAdapter.cs
- InputMethodStateChangeEventArgs.cs
- ToolStripSplitStackLayout.cs
- ActiveXHost.cs
- BaseHashHelper.cs
- EraserBehavior.cs
- CodeAccessSecurityEngine.cs
- RotateTransform3D.cs
- ListSortDescription.cs
- PolyLineSegmentFigureLogic.cs
- ContainerParagraph.cs
- AsymmetricKeyExchangeFormatter.cs
- NameService.cs
- BinaryMethodMessage.cs
- PageContentCollection.cs
- DiscardableAttribute.cs
- FastEncoder.cs
- BaseValidator.cs
- AlternateView.cs
- ProjectionPathSegment.cs
- SourceChangedEventArgs.cs
- AutoCompleteStringCollection.cs
- MenuItem.cs
- StringDictionaryCodeDomSerializer.cs
- ExpressionWriter.cs
- XmlSchemaAppInfo.cs
- ObjectDataSourceDesigner.cs
- ShadowGlyph.cs
- SystemThemeKey.cs
- Repeater.cs
- ExtensionSimplifierMarkupObject.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- CroppedBitmap.cs
- SoapServerMethod.cs
- WebConfigurationFileMap.cs
- EntityDataSourceContainerNameItem.cs
- ImportContext.cs
- FontEmbeddingManager.cs
- CodeMemberMethod.cs
- HitTestParameters.cs
- SubstitutionList.cs
- FormattedText.cs
- PersistencePipeline.cs
- RootProfilePropertySettingsCollection.cs
- DataGridToolTip.cs
- DataKeyArray.cs
- HashSetDebugView.cs
- CryptoStream.cs
- EntitySetBaseCollection.cs
- DataMisalignedException.cs
- XslCompiledTransform.cs
- DragDrop.cs
- TemplatedWizardStep.cs
- ToolStripItemBehavior.cs
- ImmutableObjectAttribute.cs
- cookieexception.cs
- SessionParameter.cs
- TypeContext.cs
- RangeValuePattern.cs
- DataViewListener.cs
- X509Utils.cs
- StorageRoot.cs
- EmptyControlCollection.cs
- Application.cs
- DispatcherProcessingDisabled.cs
- CompilerGeneratedAttribute.cs
- UInt32Converter.cs
- UnsafeNativeMethods.cs