Code:
/ FX-1434 / FX-1434 / 1.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
- BufferedGraphicsContext.cs
- InputBuffer.cs
- MarshalDirectiveException.cs
- EvidenceTypeDescriptor.cs
- WebPartMenuStyle.cs
- CommandConverter.cs
- XmlSchemaSimpleContentExtension.cs
- PipelineComponent.cs
- OpCellTreeNode.cs
- DataTableReaderListener.cs
- DesignerActionPanel.cs
- CommentEmitter.cs
- DataGridHeaderBorder.cs
- Util.cs
- ResourcePermissionBaseEntry.cs
- ConnectionStringsExpressionBuilder.cs
- AudioFileOut.cs
- SpellerStatusTable.cs
- DocumentViewerHelper.cs
- GlobalId.cs
- SqlProviderUtilities.cs
- NullableConverter.cs
- XDeferredAxisSource.cs
- DbSetClause.cs
- MergeLocalizationDirectives.cs
- StylusPointProperties.cs
- LambdaCompiler.ControlFlow.cs
- HttpModuleAction.cs
- ParsedAttributeCollection.cs
- MeshGeometry3D.cs
- PenThread.cs
- ConfigurationSection.cs
- MailDefinition.cs
- CorrelationKey.cs
- ExtendedPropertyInfo.cs
- InputMethodStateChangeEventArgs.cs
- PtsPage.cs
- OleDbException.cs
- HMAC.cs
- DbExpressionBuilder.cs
- Switch.cs
- DeviceContext2.cs
- CheckBoxField.cs
- Propagator.ExtentPlaceholderCreator.cs
- WebPartExportVerb.cs
- TypefaceMap.cs
- TableHeaderCell.cs
- HttpRuntimeSection.cs
- Queue.cs
- UInt32Storage.cs
- Stacktrace.cs
- EllipticalNodeOperations.cs
- BindValidator.cs
- CommandField.cs
- CounterSetInstance.cs
- XmlNodeComparer.cs
- FontFamilyValueSerializer.cs
- DataGridViewSelectedColumnCollection.cs
- MemoryMappedFile.cs
- ResourceReferenceExpression.cs
- FileVersionInfo.cs
- DesignTimeTemplateParser.cs
- HtmlInputPassword.cs
- HighlightComponent.cs
- GridViewItemAutomationPeer.cs
- GridItemPatternIdentifiers.cs
- LogicalExpressionEditor.cs
- XmlLanguageConverter.cs
- SafeFileMappingHandle.cs
- SqlClientWrapperSmiStream.cs
- NativeMethods.cs
- DeflateStream.cs
- ObservableCollection.cs
- NativeObjectSecurity.cs
- Currency.cs
- CompositionAdorner.cs
- JpegBitmapEncoder.cs
- Literal.cs
- TagMapInfo.cs
- SessionIDManager.cs
- SmiMetaDataProperty.cs
- Brushes.cs
- VectorCollectionValueSerializer.cs
- ClockController.cs
- Button.cs
- AdCreatedEventArgs.cs
- ColorAnimationBase.cs
- ExpressionValueEditor.cs
- DescriptionAttribute.cs
- EntityReference.cs
- PagesSection.cs
- GenericIdentity.cs
- TextElement.cs
- MessageBuffer.cs
- iisPickupDirectory.cs
- ActivityInstanceMap.cs
- WebPartMenuStyle.cs
- DbProviderFactoriesConfigurationHandler.cs
- DesignBindingConverter.cs
- ContainerParaClient.cs