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
- MinMaxParagraphWidth.cs
- ProbeMatchesMessage11.cs
- ComponentChangedEvent.cs
- UnaryNode.cs
- IERequestCache.cs
- Win32KeyboardDevice.cs
- PassportAuthentication.cs
- DataAdapter.cs
- Exceptions.cs
- UnmanagedMemoryStream.cs
- TextDpi.cs
- UmAlQuraCalendar.cs
- ReflectPropertyDescriptor.cs
- SemaphoreSecurity.cs
- QuaternionAnimationUsingKeyFrames.cs
- StateMachineSubscriptionManager.cs
- DataServiceRequest.cs
- PackageRelationship.cs
- ListBase.cs
- CryptoProvider.cs
- WpfKnownTypeInvoker.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- XmlILAnnotation.cs
- LoginName.cs
- TrackingAnnotationCollection.cs
- ClientConfigurationSystem.cs
- TypeBuilder.cs
- DebugInfoExpression.cs
- DbConnectionClosed.cs
- ClassData.cs
- XmlSchemaRedefine.cs
- XmlSchema.cs
- StylusPointPropertyInfo.cs
- _NativeSSPI.cs
- QilBinary.cs
- InplaceBitmapMetadataWriter.cs
- UnsafeNativeMethods.cs
- AnimatedTypeHelpers.cs
- HandlerBase.cs
- SemanticAnalyzer.cs
- UrlEncodedParameterWriter.cs
- Binding.cs
- ErrorTableItemStyle.cs
- AbstractDataSvcMapFileLoader.cs
- ComponentCommands.cs
- TextEditorContextMenu.cs
- TypefaceMetricsCache.cs
- SoapObjectWriter.cs
- HwndStylusInputProvider.cs
- DynamicPropertyReader.cs
- BypassElementCollection.cs
- ConfigXmlWhitespace.cs
- HttpCapabilitiesBase.cs
- WebConfigurationManager.cs
- Regex.cs
- CalendarDesigner.cs
- IteratorFilter.cs
- SponsorHelper.cs
- DataGridViewDataErrorEventArgs.cs
- SafeCryptContextHandle.cs
- EventSourceCreationData.cs
- GradientBrush.cs
- PersonalizableAttribute.cs
- X509ChainPolicy.cs
- EdmComplexPropertyAttribute.cs
- DataBindingExpressionBuilder.cs
- validationstate.cs
- ValidationSummary.cs
- GAC.cs
- TrackingServices.cs
- ErrorHandler.cs
- ZoneLinkButton.cs
- XmlAttribute.cs
- Socket.cs
- SimpleApplicationHost.cs
- ValidatedControlConverter.cs
- DependencyPropertyDescriptor.cs
- tibetanshape.cs
- WebBrowser.cs
- SamlAssertionKeyIdentifierClause.cs
- XmlSchemaException.cs
- HMACSHA256.cs
- StyleSelector.cs
- WmlControlAdapter.cs
- GenericEnumConverter.cs
- MemoryStream.cs
- GradientStop.cs
- SrgsRulesCollection.cs
- ThreadPoolTaskScheduler.cs
- XPathQilFactory.cs
- DivideByZeroException.cs
- WSSecurityTokenSerializer.cs
- TextRange.cs
- CachedPathData.cs
- PTConverter.cs
- EncoderNLS.cs
- SelectedDatesCollection.cs
- ImageConverter.cs
- ExpressionStringBuilder.cs
- DependencyPropertyValueSerializer.cs