Code:
/ DotNET / DotNET / 8.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
- MergeLocalizationDirectives.cs
- XmlMtomWriter.cs
- X509CertificateChain.cs
- XmlAttributeAttribute.cs
- DataGridCell.cs
- LinqDataSourceDisposeEventArgs.cs
- EnumMember.cs
- SafeRegistryHandle.cs
- AnimationClock.cs
- Table.cs
- CompositeActivityValidator.cs
- ValidationResult.cs
- cookiecollection.cs
- nulltextnavigator.cs
- Stroke.cs
- BitmapMetadata.cs
- FullTrustAssembliesSection.cs
- COAUTHINFO.cs
- XmlSchemaAnyAttribute.cs
- PropertyEntry.cs
- DrawTreeNodeEventArgs.cs
- DataBoundControl.cs
- StructuredTypeInfo.cs
- SimpleType.cs
- FieldCollectionEditor.cs
- RunInstallerAttribute.cs
- TemplateNodeContextMenu.cs
- ImageFormat.cs
- LocationUpdates.cs
- ColorConverter.cs
- ObjectQuery.cs
- XpsFilter.cs
- Stroke2.cs
- DockProviderWrapper.cs
- DesignerActionList.cs
- StateDesigner.Helpers.cs
- XmlAutoDetectWriter.cs
- HtmlTable.cs
- Action.cs
- AsyncParams.cs
- RegisterResponseInfo.cs
- MetaForeignKeyColumn.cs
- CompareValidator.cs
- CodeDomSerializerBase.cs
- CatalogPartCollection.cs
- PropertyPathWorker.cs
- FileRecordSequenceHelper.cs
- DbConnectionPoolIdentity.cs
- PropertyInfo.cs
- WebPartEditorCancelVerb.cs
- HttpVersion.cs
- ParallelRangeManager.cs
- MutexSecurity.cs
- PnrpPermission.cs
- XmlNode.cs
- StorageInfo.cs
- SafeSystemMetrics.cs
- XmlExtensionFunction.cs
- ListViewInsertedEventArgs.cs
- MatrixAnimationUsingPath.cs
- TextServicesCompartment.cs
- LiteralSubsegment.cs
- TriggerActionCollection.cs
- PersonalizableAttribute.cs
- XComponentModel.cs
- StringResourceManager.cs
- HebrewCalendar.cs
- MergePropertyDescriptor.cs
- MemoryMappedViewAccessor.cs
- EventSinkHelperWriter.cs
- ScrollEventArgs.cs
- TypedReference.cs
- Privilege.cs
- GridErrorDlg.cs
- EntryWrittenEventArgs.cs
- OleDbPropertySetGuid.cs
- OutOfProcStateClientManager.cs
- xsdvalidator.cs
- connectionpool.cs
- LogicalTreeHelper.cs
- DocumentReferenceCollection.cs
- DbConnectionFactory.cs
- DnsPermission.cs
- BindStream.cs
- ClientConvert.cs
- StateWorkerRequest.cs
- TextContainerChangeEventArgs.cs
- OdbcConnectionHandle.cs
- MatrixStack.cs
- ClientSettingsProvider.cs
- CharEntityEncoderFallback.cs
- CodeGotoStatement.cs
- ExpandCollapsePattern.cs
- CheckBoxList.cs
- LinearGradientBrush.cs
- SafeSecurityHandles.cs
- Condition.cs
- ParameterCollection.cs
- DynamicDocumentPaginator.cs
- MimeBasePart.cs