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
- ResourceReader.cs
- SecurityKeyType.cs
- SynchronizationContext.cs
- XamlParser.cs
- DesignerSerializationOptionsAttribute.cs
- WebHttpElement.cs
- ComponentRenameEvent.cs
- TextServicesCompartmentContext.cs
- XmlSchemaObject.cs
- Wildcard.cs
- SetStoryboardSpeedRatio.cs
- SqlDataSourceStatusEventArgs.cs
- precedingsibling.cs
- SqlCaseSimplifier.cs
- WebContext.cs
- FilteredXmlReader.cs
- CharStorage.cs
- EntityContainerEntitySetDefiningQuery.cs
- TypeDefinition.cs
- DependencyPropertyDescriptor.cs
- ValueChangedEventManager.cs
- MemoryPressure.cs
- Polyline.cs
- QilInvokeLateBound.cs
- MostlySingletonList.cs
- XmlSchemaDocumentation.cs
- WebContext.cs
- SchemaManager.cs
- SystemPens.cs
- ConnectionStringEditor.cs
- KeyInfo.cs
- BaseAppDomainProtocolHandler.cs
- NavigationService.cs
- XmlQualifiedName.cs
- MappingSource.cs
- Fault.cs
- SqlSelectStatement.cs
- _DomainName.cs
- GetWorkflowTree.cs
- PathSegmentCollection.cs
- ValidatorCompatibilityHelper.cs
- XmlDomTextWriter.cs
- Cursors.cs
- GlyphRunDrawing.cs
- DataGridViewHeaderCell.cs
- Run.cs
- SoapSchemaExporter.cs
- Int64AnimationBase.cs
- OdbcEnvironment.cs
- WorkflowViewService.cs
- OpacityConverter.cs
- ClientFormsAuthenticationCredentials.cs
- XsdCachingReader.cs
- PasswordPropertyTextAttribute.cs
- CustomAttributeBuilder.cs
- InstanceOwnerException.cs
- _AutoWebProxyScriptEngine.cs
- HttpListenerResponse.cs
- SqlDataSourceStatusEventArgs.cs
- ActivityScheduledQuery.cs
- SafeMemoryMappedFileHandle.cs
- UpDownEvent.cs
- StrokeDescriptor.cs
- XamlTypeMapperSchemaContext.cs
- PropertyPanel.cs
- ControlAdapter.cs
- SafeRightsManagementHandle.cs
- MethodInfo.cs
- WebServiceHostFactory.cs
- UnsafeNativeMethods.cs
- TreeBuilderXamlTranslator.cs
- EventMemberCodeDomSerializer.cs
- ApplicationSecurityInfo.cs
- AspNetSynchronizationContext.cs
- Script.cs
- InternalMappingException.cs
- StringWriter.cs
- CompleteWizardStep.cs
- BufferAllocator.cs
- InstanceDataCollection.cs
- DataColumnCollection.cs
- HotSpotCollection.cs
- LedgerEntry.cs
- ProtocolElement.cs
- XmlNullResolver.cs
- ReadOnlyCollectionBase.cs
- ToolStripTemplateNode.cs
- EntityContainer.cs
- Timer.cs
- XmlReader.cs
- SoapClientMessage.cs
- ValidationResult.cs
- VariableAction.cs
- HttpStreamXmlDictionaryReader.cs
- CaseCqlBlock.cs
- XmlTextReaderImpl.cs
- MasterPageCodeDomTreeGenerator.cs
- ModelFunction.cs
- AnalyzedTree.cs
- PaintEvent.cs