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
- CodeMethodReturnStatement.cs
- PerformanceCounters.cs
- Item.cs
- ScrollChrome.cs
- TextDataBindingHandler.cs
- DependencyPropertyHelper.cs
- keycontainerpermission.cs
- CompressEmulationStream.cs
- SectionXmlInfo.cs
- NameValueFileSectionHandler.cs
- SqlTypeConverter.cs
- GenericPrincipal.cs
- ChildChangedEventArgs.cs
- SQlBooleanStorage.cs
- SystemIcmpV4Statistics.cs
- AsymmetricKeyExchangeDeformatter.cs
- ListBoxItem.cs
- Mouse.cs
- HtmlElement.cs
- WSUtilitySpecificationVersion.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ImageFormatConverter.cs
- BinaryOperationBinder.cs
- ScriptControlManager.cs
- ActivityDesigner.cs
- RenderContext.cs
- FixedPageProcessor.cs
- CreateBookmarkScope.cs
- XmlnsPrefixAttribute.cs
- XamlPointCollectionSerializer.cs
- DbConnectionFactory.cs
- PreservationFileReader.cs
- ActivityTypeResolver.xaml.cs
- TypeUtil.cs
- CompilerTypeWithParams.cs
- FixedPosition.cs
- Privilege.cs
- RowUpdatingEventArgs.cs
- FileDialog_Vista_Interop.cs
- GenericTypeParameterBuilder.cs
- NumberFunctions.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- EditorAttributeInfo.cs
- DbModificationCommandTree.cs
- DocumentReference.cs
- ProjectionCamera.cs
- IisTraceListener.cs
- DynamicObjectAccessor.cs
- BlurBitmapEffect.cs
- RangeValuePatternIdentifiers.cs
- UriScheme.cs
- VisualTreeHelper.cs
- ScriptDescriptor.cs
- TrackingSection.cs
- ExponentialEase.cs
- ToolStripButton.cs
- Merger.cs
- ClientCultureInfo.cs
- DataGridTablesFactory.cs
- PeerToPeerException.cs
- DataGridRowHeaderAutomationPeer.cs
- AttachedProperty.cs
- ApplicationContext.cs
- InputMethod.cs
- SystemUnicastIPAddressInformation.cs
- AsyncStreamReader.cs
- HttpInputStream.cs
- SoapAttributeAttribute.cs
- FlowLayoutPanel.cs
- ActivityCodeDomSerializationManager.cs
- CaseCqlBlock.cs
- ControlParameter.cs
- FileChangesMonitor.cs
- DbException.cs
- HttpRequestCacheValidator.cs
- SevenBitStream.cs
- TextEffect.cs
- CodeObjectCreateExpression.cs
- InstanceDataCollection.cs
- FormView.cs
- VerticalConnector.xaml.cs
- FileDataSourceCache.cs
- StateMachine.cs
- BitmapEffectGroup.cs
- HttpCachePolicyElement.cs
- InvalidDataContractException.cs
- BitmapEffectInput.cs
- WebPartConnectionsCancelEventArgs.cs
- ToolStripSystemRenderer.cs
- SoapIgnoreAttribute.cs
- SqlDataSourceWizardForm.cs
- TextPointer.cs
- Oid.cs
- XmlEntity.cs
- TransformGroup.cs
- Int32Storage.cs
- ConstructorExpr.cs
- QilInvokeEarlyBound.cs
- NoResizeSelectionBorderGlyph.cs
- COM2IPerPropertyBrowsingHandler.cs