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
- InvokeMemberBinder.cs
- DesignerAdapterUtil.cs
- PolygonHotSpot.cs
- AxWrapperGen.cs
- SerializationSectionGroup.cs
- Attributes.cs
- DisplayMemberTemplateSelector.cs
- _SingleItemRequestCache.cs
- Vector3DIndependentAnimationStorage.cs
- BindableAttribute.cs
- DataGridViewMethods.cs
- Point.cs
- PointCollectionConverter.cs
- CodeSpit.cs
- BamlRecordReader.cs
- PersistenceProviderFactory.cs
- AppDomainManager.cs
- DocComment.cs
- EntityDataSourceWizardForm.cs
- UserControlParser.cs
- ObjectParameterCollection.cs
- PasswordRecoveryAutoFormat.cs
- EntitySqlException.cs
- TimeZone.cs
- OleDbDataAdapter.cs
- CustomErrorsSectionWrapper.cs
- BamlTreeNode.cs
- TemplatedWizardStep.cs
- MetadataSource.cs
- Function.cs
- webeventbuffer.cs
- GeneralTransform3DTo2D.cs
- XMLSyntaxException.cs
- PopupRoot.cs
- SemanticKeyElement.cs
- ComboBoxHelper.cs
- SafeEventLogWriteHandle.cs
- BulletedListEventArgs.cs
- BitmapEffectCollection.cs
- GenericRootAutomationPeer.cs
- Atom10FeedFormatter.cs
- RegexCharClass.cs
- OrCondition.cs
- WebPartCancelEventArgs.cs
- CodeEventReferenceExpression.cs
- PropertyInformation.cs
- SQLDateTimeStorage.cs
- CodeDelegateCreateExpression.cs
- Variable.cs
- ConfigurationStrings.cs
- TransformProviderWrapper.cs
- FrameworkTextComposition.cs
- PositiveTimeSpanValidatorAttribute.cs
- HttpHeaderCollection.cs
- DataSourceHelper.cs
- MailHeaderInfo.cs
- TextDataBindingHandler.cs
- SqlDuplicator.cs
- WebHttpBindingElement.cs
- PropertyGroupDescription.cs
- WindowsToolbarAsMenu.cs
- NetMsmqSecurityMode.cs
- HttpModuleCollection.cs
- RadioButton.cs
- IxmlLineInfo.cs
- RouteItem.cs
- RadioButtonBaseAdapter.cs
- LabelDesigner.cs
- Parameter.cs
- PagerSettings.cs
- WriteFileContext.cs
- PresentationAppDomainManager.cs
- X509Certificate.cs
- StrokeFIndices.cs
- HtmlTableCell.cs
- XmlIterators.cs
- OleDbRowUpdatingEvent.cs
- ELinqQueryState.cs
- ObjectContextServiceProvider.cs
- X509RawDataKeyIdentifierClause.cs
- GridViewRowEventArgs.cs
- WindowsListViewItemStartMenu.cs
- WebPartDisplayModeEventArgs.cs
- NameValueSectionHandler.cs
- Message.cs
- EnumConverter.cs
- ServiceOperation.cs
- ManifestResourceInfo.cs
- BasicBrowserDialog.designer.cs
- IndexedString.cs
- FormCollection.cs
- Registry.cs
- AddInEnvironment.cs
- HtmlMeta.cs
- DataSourceIDConverter.cs
- WebBrowserContainer.cs
- DataGridGeneralPage.cs
- Utility.cs
- HtmlInputRadioButton.cs
- ScriptingAuthenticationServiceSection.cs