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
- IfAction.cs
- ToolStripItemRenderEventArgs.cs
- CompositionAdorner.cs
- EditorPartCollection.cs
- FixedSOMLineRanges.cs
- FirstMatchCodeGroup.cs
- SafeTimerHandle.cs
- EqualityComparer.cs
- Debug.cs
- SHA1.cs
- BuildProvider.cs
- AttributeInfo.cs
- DataGridViewControlCollection.cs
- Point4DValueSerializer.cs
- DataTableClearEvent.cs
- Size3DConverter.cs
- Facet.cs
- ParallelActivityDesigner.cs
- Point3DKeyFrameCollection.cs
- LayoutSettings.cs
- Metadata.cs
- CacheMemory.cs
- _KerberosClient.cs
- TemplateXamlParser.cs
- BaseTemplateParser.cs
- _TimerThread.cs
- ImageFormat.cs
- NonClientArea.cs
- PropertyChangingEventArgs.cs
- ProfileElement.cs
- PtsHelper.cs
- SecurityProtocolFactory.cs
- ETagAttribute.cs
- PaintEvent.cs
- ComponentDispatcher.cs
- Boolean.cs
- IconConverter.cs
- BinaryMessageFormatter.cs
- InputProcessorProfilesLoader.cs
- SerializerProvider.cs
- FileChangeNotifier.cs
- DataGridViewCellCollection.cs
- ArgIterator.cs
- DynamicDataManager.cs
- XmlSchemaAny.cs
- ApplicationProxyInternal.cs
- TreeNodeStyle.cs
- ListItemDetailViewAttribute.cs
- ShapingWorkspace.cs
- OlePropertyStructs.cs
- SecurityAttributeGenerationHelper.cs
- DesignSurfaceServiceContainer.cs
- ElementAction.cs
- ModuleElement.cs
- DropDownButton.cs
- DoubleLink.cs
- ClientRolePrincipal.cs
- GeneralTransform3D.cs
- XmlDataImplementation.cs
- DesigntimeLicenseContext.cs
- StackOverflowException.cs
- ObfuscateAssemblyAttribute.cs
- RowUpdatedEventArgs.cs
- PtsContext.cs
- CallbackException.cs
- SharedUtils.cs
- ToolStripContentPanel.cs
- SortDescription.cs
- OdbcFactory.cs
- TimeSpanOrInfiniteConverter.cs
- PathFigureCollection.cs
- String.cs
- EnumConverter.cs
- ContextQuery.cs
- CustomError.cs
- BookmarkScope.cs
- SetState.cs
- DetailsViewRow.cs
- RegexReplacement.cs
- VirtualDirectoryMappingCollection.cs
- Event.cs
- ProfileProvider.cs
- Compilation.cs
- ProcessStartInfo.cs
- TextOptions.cs
- SecurityPermission.cs
- SmtpSection.cs
- WMICapabilities.cs
- StateItem.cs
- DispatcherExceptionFilterEventArgs.cs
- SamlAction.cs
- Mapping.cs
- RefreshPropertiesAttribute.cs
- MemberRestriction.cs
- StateFinalizationDesigner.cs
- CharConverter.cs
- Rights.cs
- PersianCalendar.cs
- BulletDecorator.cs
- GridViewColumnCollectionChangedEventArgs.cs