Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebParts / DesignerCatalogPartChrome.cs / 1 / DesignerCatalogPartChrome.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls.WebParts { using System.Collections; using System.Collections.Specialized; using System.Design; using System.Globalization; using System.IO; using System.Web.UI; using System.Web.UI.Design; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] internal class DesignerCatalogPartChrome : CatalogPartChrome { private ViewRendering _partViewRendering; public DesignerCatalogPartChrome(CatalogZone zone) : base(zone) { } public ViewRendering GetViewRendering(Control control) { CatalogPart part = control as CatalogPart; if (part == null) { // The control is not a CatalogPart, so we should render an error block. (VSWhidbey 232109) string errorDesignTimeHtml = ControlDesigner.CreateErrorDesignTimeHtml( SR.GetString(SR.CatalogZoneDesigner_OnlyCatalogParts), null, control); return new ViewRendering(errorDesignTimeHtml, new DesignerRegionCollection()); } else { string designTimeHtml; DesignerRegionCollection regions; try { // Set Zone for CatalogPart at design-time IDictionary param = new HybridDictionary(1); param["Zone"] = Zone; ((IControlDesignerAccessor)part).SetDesignModeState(param); _partViewRendering = ControlDesigner.GetViewRendering(part); regions = _partViewRendering.Regions; StringWriter writer = new StringWriter(CultureInfo.InvariantCulture); // Pass in the ViewControl instead of the CatalogPart, so that design-time themes are // reflected in the Chrome rendering RenderCatalogPart(new DesignTimeHtmlTextWriter(writer), (CatalogPart)PartDesigner.GetViewControl(part)); designTimeHtml = writer.ToString(); } catch (Exception e) { designTimeHtml = ControlDesigner.CreateErrorDesignTimeHtml( SR.GetString(SR.ControlDesigner_UnhandledException), e, control); regions = new DesignerRegionCollection(); } return new ViewRendering(designTimeHtml, regions); } } protected override void RenderPartContents(HtmlTextWriter writer, CatalogPart catalogPart) { writer.Write(_partViewRendering.Content); } } } // 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
- ModelFunctionTypeElement.cs
- InputMethodStateChangeEventArgs.cs
- SpecialNameAttribute.cs
- TabControl.cs
- ToolboxItemAttribute.cs
- QuaternionAnimationUsingKeyFrames.cs
- SelectionHighlightInfo.cs
- ServiceInfoCollection.cs
- BitmapEffectGeneralTransform.cs
- TextOnlyOutput.cs
- OracleParameter.cs
- _CookieModule.cs
- SoapExtensionTypeElementCollection.cs
- DrawingGroupDrawingContext.cs
- AttachedAnnotation.cs
- SecurityState.cs
- ColumnResizeAdorner.cs
- MessageContractMemberAttribute.cs
- StringWriter.cs
- DependsOnAttribute.cs
- ConfigurationValidatorAttribute.cs
- XamlStyleSerializer.cs
- CallSiteBinder.cs
- ServiceProviders.cs
- SafeSerializationManager.cs
- TableStyle.cs
- XmlSchemaComplexType.cs
- _MultipleConnectAsync.cs
- TemplateContainer.cs
- XmlSerializerNamespaces.cs
- ProgressBar.cs
- FramingChannels.cs
- ComponentConverter.cs
- RenderDataDrawingContext.cs
- SplitterCancelEvent.cs
- WebServiceAttribute.cs
- sqlinternaltransaction.cs
- ResolveCriteriaCD1.cs
- HtmlButton.cs
- PolicyChain.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- NetDataContractSerializer.cs
- TcpClientSocketManager.cs
- X509AsymmetricSecurityKey.cs
- DocumentOrderComparer.cs
- mansign.cs
- EdmMember.cs
- FixedHyperLink.cs
- TextSearch.cs
- ContainerVisual.cs
- DataSourceControlBuilder.cs
- AuthenticationServiceManager.cs
- SemaphoreFullException.cs
- CommandBinding.cs
- TypeUnloadedException.cs
- SQLDecimal.cs
- XNodeNavigator.cs
- UserControlFileEditor.cs
- ContextMenu.cs
- ListItemParagraph.cs
- Variable.cs
- CacheRequest.cs
- PenContext.cs
- CommonProperties.cs
- AsyncCompletedEventArgs.cs
- CodeTryCatchFinallyStatement.cs
- DbMetaDataFactory.cs
- Cloud.cs
- LogicalTreeHelper.cs
- Visual3D.cs
- SelectionList.cs
- mil_commands.cs
- CaretElement.cs
- NumberSubstitution.cs
- InkPresenter.cs
- ToolStripRenderer.cs
- ClientSettingsSection.cs
- ParserContext.cs
- RequestSecurityToken.cs
- XmlComment.cs
- ConfigurationPermission.cs
- CheckBoxRenderer.cs
- XmlEventCache.cs
- CommandEventArgs.cs
- sqlpipe.cs
- TransactionScopeDesigner.cs
- ReceiveDesigner.xaml.cs
- ObjectKeyFrameCollection.cs
- ExceptionCollection.cs
- EndpointAddress10.cs
- WeakRefEnumerator.cs
- HwndSource.cs
- ToolStripManager.cs
- TextSpanModifier.cs
- DocumentsTrace.cs
- CookieHandler.cs
- ResourceDisplayNameAttribute.cs
- SQLConvert.cs
- Propagator.Evaluator.cs
- HtmlInputButton.cs