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
- DocumentPaginator.cs
- InvokeProviderWrapper.cs
- MobileListItem.cs
- IndexingContentUnit.cs
- AliasedSlot.cs
- CustomErrorsSectionWrapper.cs
- AbstractExpressions.cs
- DataGridViewSortCompareEventArgs.cs
- WebPartMenuStyle.cs
- ConfigurationLocationCollection.cs
- Point4D.cs
- OperationResponse.cs
- TreeViewItemAutomationPeer.cs
- SystemInfo.cs
- FilteredDataSetHelper.cs
- SpecialFolderEnumConverter.cs
- PackagePart.cs
- WmlListAdapter.cs
- CellTreeNodeVisitors.cs
- NetworkStream.cs
- Parsers.cs
- DataDocumentXPathNavigator.cs
- SmtpCommands.cs
- UriParserTemplates.cs
- Constant.cs
- ElementProxy.cs
- LongCountAggregationOperator.cs
- ZoneButton.cs
- DataGridItemEventArgs.cs
- FormatConvertedBitmap.cs
- UrlPropertyAttribute.cs
- MimeBasePart.cs
- XmlDocumentFieldSchema.cs
- CodeAttributeDeclaration.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- Evaluator.cs
- ExtendedProtectionPolicyTypeConverter.cs
- UTF32Encoding.cs
- SerialStream.cs
- MouseDevice.cs
- _SingleItemRequestCache.cs
- Animatable.cs
- AttributeAction.cs
- LayoutManager.cs
- Expressions.cs
- ComplexPropertyEntry.cs
- RsaSecurityToken.cs
- BamlLocalizableResourceKey.cs
- RegexStringValidator.cs
- PriorityItem.cs
- SQLSingleStorage.cs
- PlatformNotSupportedException.cs
- MembershipSection.cs
- XmlRootAttribute.cs
- KeyTime.cs
- VirtualizingStackPanel.cs
- LinkLabelLinkClickedEvent.cs
- BuildProviderAppliesToAttribute.cs
- EntityCommandDefinition.cs
- QilIterator.cs
- XmlWellformedWriter.cs
- DataGridViewColumnCollectionEditor.cs
- ObjectItemCachedAssemblyLoader.cs
- SiblingIterators.cs
- ReflectionServiceProvider.cs
- BeginStoryboard.cs
- ISO2022Encoding.cs
- RemotingException.cs
- TabletCollection.cs
- XmlIlGenerator.cs
- TextDpi.cs
- GPPOINTF.cs
- ToolStripHighContrastRenderer.cs
- ConfigurationStrings.cs
- MergeFilterQuery.cs
- DrawListViewColumnHeaderEventArgs.cs
- ProcessManager.cs
- MarshalDirectiveException.cs
- ElementAction.cs
- HashSet.cs
- AutoCompleteStringCollection.cs
- SchemaTypeEmitter.cs
- DataTableReader.cs
- SerializationAttributes.cs
- ComponentSerializationService.cs
- ManagementEventArgs.cs
- ReadContentAsBinaryHelper.cs
- LineInfo.cs
- HtmlDocument.cs
- XmlSchema.cs
- WebEventTraceProvider.cs
- DateBoldEvent.cs
- RTLAwareMessageBox.cs
- HttpCookieCollection.cs
- ModelUtilities.cs
- WebServiceEnumData.cs
- ConfigurationPermission.cs
- HttpUnhandledOperationInvoker.cs
- ScriptReferenceBase.cs
- IisNotInstalledException.cs