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
- ClientScriptManagerWrapper.cs
- ProviderCollection.cs
- StateDesigner.Helpers.cs
- ObjectResult.cs
- FontFamily.cs
- ProcessThread.cs
- IgnoreSectionHandler.cs
- ToggleProviderWrapper.cs
- SpecularMaterial.cs
- DbProviderManifest.cs
- WindowsToolbarAsMenu.cs
- UnmanagedMemoryStreamWrapper.cs
- DataSourceXmlSerializationAttribute.cs
- Soap.cs
- SchemaElementLookUpTable.cs
- StringReader.cs
- SymmetricCryptoHandle.cs
- NumericUpDown.cs
- ForwardPositionQuery.cs
- ColumnBinding.cs
- ImageButton.cs
- GraphicsPath.cs
- IsolatedStorageException.cs
- SerializationSectionGroup.cs
- GrammarBuilderBase.cs
- ASCIIEncoding.cs
- EventlogProvider.cs
- SafeTokenHandle.cs
- PocoEntityKeyStrategy.cs
- PathFigureCollectionValueSerializer.cs
- XmlImplementation.cs
- TagPrefixCollection.cs
- UnmanagedMemoryStreamWrapper.cs
- CodeArgumentReferenceExpression.cs
- cookieexception.cs
- ToggleButton.cs
- TextParagraphCache.cs
- UnsafeNativeMethodsPenimc.cs
- MainMenu.cs
- StatusBar.cs
- ImmutableAssemblyCacheEntry.cs
- ComNativeDescriptor.cs
- InternalResources.cs
- DiscoveryReferences.cs
- Int16Storage.cs
- MatrixKeyFrameCollection.cs
- SapiRecoInterop.cs
- VirtualPathExtension.cs
- TableRowGroup.cs
- AppDomain.cs
- HttpConfigurationSystem.cs
- BindingList.cs
- ServiceProviders.cs
- ProfileService.cs
- AxParameterData.cs
- InheritanceRules.cs
- SrgsDocumentParser.cs
- ObservableDictionary.cs
- TrustManagerPromptUI.cs
- Adorner.cs
- RelatedImageListAttribute.cs
- PageOutputQuality.cs
- GPStream.cs
- FileUtil.cs
- OleDbReferenceCollection.cs
- XmlLinkedNode.cs
- FragmentQueryKB.cs
- ScriptReferenceEventArgs.cs
- EdmComplexPropertyAttribute.cs
- StylusDevice.cs
- SurrogateSelector.cs
- DESCryptoServiceProvider.cs
- JsonXmlDataContract.cs
- WindowHideOrCloseTracker.cs
- SessionState.cs
- CrossContextChannel.cs
- Attributes.cs
- ScrollPattern.cs
- WmpBitmapEncoder.cs
- PaperSize.cs
- CompressedStack.cs
- XmlSchemaComplexContentExtension.cs
- CodeIdentifiers.cs
- RootNamespaceAttribute.cs
- ThumbAutomationPeer.cs
- ExternalException.cs
- WebPartConnectionsCancelEventArgs.cs
- TextDecorationCollectionConverter.cs
- InputDevice.cs
- MachineKey.cs
- SqlDataSource.cs
- PageCatalogPart.cs
- BufferedOutputStream.cs
- ButtonBaseAutomationPeer.cs
- FlowPosition.cs
- ColorEditor.cs
- KeyValuePair.cs
- _MultipleConnectAsync.cs
- DependencyPropertyKey.cs
- ErrorLog.cs