Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / PanelContainerDesigner.cs / 2 / PanelContainerDesigner.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System; using System.Collections; using System.ComponentModel; using System.Web.UI.Design; using System.Web.UI.WebControls; ///public class PanelContainerDesigner : ContainerControlDesigner { private const string PanelWithCaptionDesignTimeHtml = @" "; private const string PanelNoCaptionDesignTimeHtml = @""; internal override string DesignTimeHtml { get { if (FrameCaption.Length > 0) { return PanelWithCaptionDesignTimeHtml; } return PanelNoCaptionDesignTimeHtml; } } ////// public override string FrameCaption { get { return ((Panel)Component).GroupingText; } } /// /// public override Style FrameStyle { get { if (((Panel)Component).GroupingText.Length == 0) { return new Style(); } else { return base.FrameStyle; } } } protected override void AddDesignTimeCssAttributes(IDictionary styleAttributes) { Panel panel = (Panel)Component; switch (panel.Direction) { case ContentDirection.RightToLeft: styleAttributes["direction"] = "rtl"; break; case ContentDirection.LeftToRight: styleAttributes["direction"] = "ltr"; break; } string s = panel.BackImageUrl; if (s.Trim().Length > 0) { IUrlResolutionService resolutionService = (IUrlResolutionService)GetService(typeof(IUrlResolutionService)); if (resolutionService != null) { s = resolutionService.ResolveClientUrl(s); styleAttributes["background-image"] = "url(" + s + ")"; } } switch (panel.ScrollBars) { case ScrollBars.Horizontal: styleAttributes["overflow-x"] = "scroll"; break; case ScrollBars.Vertical: styleAttributes["overflow-y"] = "scroll"; break; case ScrollBars.Both: styleAttributes["overflow"] = "scroll"; break; case ScrollBars.Auto: styleAttributes["overflow"] = "auto"; break; } HorizontalAlign hAlign = panel.HorizontalAlign; if (hAlign != HorizontalAlign.NotSet) { TypeConverter hac = TypeDescriptor.GetConverter(typeof(HorizontalAlign)); styleAttributes["text-align"] = hac.ConvertToInvariantString(hAlign).ToLowerInvariant(); } if (!panel.Wrap) { styleAttributes["white-space"] = "nowrap"; } base.AddDesignTimeCssAttributes(styleAttributes); } protected override bool UsePreviewControl { get { return true; } } /// /// public override void Initialize(IComponent component) { VerifyInitializeArgument(component, typeof(Panel)); base.Initialize(component); } } } // 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
- MouseOverProperty.cs
- PrinterUnitConvert.cs
- RunClient.cs
- BorderGapMaskConverter.cs
- DbConnectionInternal.cs
- GroupDescription.cs
- XmlAttributes.cs
- Binding.cs
- CustomLineCap.cs
- XPathItem.cs
- EventManager.cs
- ConvertEvent.cs
- SpotLight.cs
- Currency.cs
- OperationGenerator.cs
- FillErrorEventArgs.cs
- ActivityStatusChangeEventArgs.cs
- DataGridViewRowHeaderCell.cs
- DataColumnPropertyDescriptor.cs
- ObjectListShowCommandsEventArgs.cs
- Models.cs
- EntryWrittenEventArgs.cs
- FontWeights.cs
- InlineCollection.cs
- FilterElement.cs
- SafeFileHandle.cs
- SparseMemoryStream.cs
- BrowserCapabilitiesFactory.cs
- ContainerAction.cs
- PageTheme.cs
- ChangeBlockUndoRecord.cs
- KeyGestureConverter.cs
- IPAddressCollection.cs
- EventLogSession.cs
- ResourceExpression.cs
- Control.cs
- ConfigurationFileMap.cs
- ColumnMap.cs
- SelectionProcessor.cs
- OpacityConverter.cs
- PageThemeParser.cs
- TextCompositionManager.cs
- altserialization.cs
- KeyboardEventArgs.cs
- login.cs
- ImmComposition.cs
- SessionPageStateSection.cs
- ApplicationActivator.cs
- RecordBuilder.cs
- SignatureToken.cs
- ISFTagAndGuidCache.cs
- BitmapCacheBrush.cs
- TargetPerspective.cs
- SqlDataRecord.cs
- StrongNameUtility.cs
- FormViewDeleteEventArgs.cs
- ConfigurationStrings.cs
- RegistryKey.cs
- DataGridViewComboBoxEditingControl.cs
- RegistrySecurity.cs
- QueryStringConverter.cs
- CatalogZoneBase.cs
- RawStylusSystemGestureInputReport.cs
- TransferRequestHandler.cs
- StickyNoteHelper.cs
- EnumUnknown.cs
- FtpCachePolicyElement.cs
- DataServiceQueryContinuation.cs
- OracleBFile.cs
- ServiceContractDetailViewControl.cs
- KoreanCalendar.cs
- DelimitedListTraceListener.cs
- Formatter.cs
- ArrayElementGridEntry.cs
- Run.cs
- ContextDataSourceView.cs
- SerialPort.cs
- StrongNameMembershipCondition.cs
- ConstructorNeedsTagAttribute.cs
- ToolboxComponentsCreatedEventArgs.cs
- FrameDimension.cs
- InputDevice.cs
- ControlEvent.cs
- BoundsDrawingContextWalker.cs
- GZipDecoder.cs
- MessageSecurityOverHttpElement.cs
- DataRelation.cs
- BaseCodeDomTreeGenerator.cs
- AssociationSetMetadata.cs
- Vars.cs
- ElapsedEventArgs.cs
- PseudoWebRequest.cs
- Accessible.cs
- RewritingSimplifier.cs
- ItemChangedEventArgs.cs
- CryptoProvider.cs
- Application.cs
- ChameleonKey.cs
- TrustLevel.cs
- DataColumnCollection.cs