Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebParts / DesignerEditorPartChrome.cs / 1 / DesignerEditorPartChrome.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 DesignerEditorPartChrome : EditorPartChrome { private ViewRendering _partViewRendering; public DesignerEditorPartChrome(EditorZone zone) : base(zone) { } public ViewRendering GetViewRendering(Control control) { EditorPart part = control as EditorPart; if (part == null) { // The control is not an EditorPart, so we should render an error block. (VSWhidbey 232109) string errorDesignTimeHtml = ControlDesigner.CreateErrorDesignTimeHtml( SR.GetString(SR.EditorZoneDesigner_OnlyEditorParts), null, control); return new ViewRendering(errorDesignTimeHtml, new DesignerRegionCollection()); } else { string designTimeHtml; DesignerRegionCollection regions; try { // Set Zone for EditorPart 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 EditorPart, so that design-time themes are // reflected in the Chrome rendering RenderEditorPart(new DesignTimeHtmlTextWriter(writer), (EditorPart)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, EditorPart editorPart) { 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
- ZipIOLocalFileBlock.cs
- ListViewItemMouseHoverEvent.cs
- StylusShape.cs
- CompileLiteralTextParser.cs
- StreamingContext.cs
- EndSelectCardRequest.cs
- TimelineClockCollection.cs
- SoapProtocolReflector.cs
- StatusBarDrawItemEvent.cs
- BaseCAMarshaler.cs
- TdsParameterSetter.cs
- COMException.cs
- webeventbuffer.cs
- MsdtcWrapper.cs
- SettingsBindableAttribute.cs
- SecurityKeyType.cs
- SqlAliasesReferenced.cs
- UndoUnit.cs
- TemplatedMailWebEventProvider.cs
- localization.cs
- EnumConverter.cs
- RuleSettings.cs
- GeneratedContractType.cs
- EntityModelBuildProvider.cs
- ContentDisposition.cs
- RightsManagementEncryptedStream.cs
- CellTreeNode.cs
- Inflater.cs
- ReferentialConstraint.cs
- HttpContext.cs
- WebPartConnectionsConnectVerb.cs
- DataControlImageButton.cs
- SmtpNtlmAuthenticationModule.cs
- AdornedElementPlaceholder.cs
- DataTableReaderListener.cs
- _Events.cs
- HwndTarget.cs
- SingleKeyFrameCollection.cs
- KeyValuePair.cs
- SqlXml.cs
- CalendarItem.cs
- EdmProperty.cs
- MailDefinitionBodyFileNameEditor.cs
- AsyncPostBackTrigger.cs
- FtpCachePolicyElement.cs
- SchemaType.cs
- TdsParameterSetter.cs
- PngBitmapDecoder.cs
- FileFormatException.cs
- WindowShowOrOpenTracker.cs
- VBIdentifierName.cs
- StateWorkerRequest.cs
- ProtocolsConfiguration.cs
- MailSettingsSection.cs
- Button.cs
- FontFamilyConverter.cs
- BlobPersonalizationState.cs
- RequestReplyCorrelator.cs
- PageThemeCodeDomTreeGenerator.cs
- DesignColumnCollection.cs
- ReaderWriterLockWrapper.cs
- SharedStatics.cs
- HandlerBase.cs
- TranslateTransform3D.cs
- SystemTcpStatistics.cs
- BrowserDefinition.cs
- XmlNamedNodeMap.cs
- LoginNameDesigner.cs
- PackageRelationshipSelector.cs
- TemplateControlCodeDomTreeGenerator.cs
- Soap.cs
- Geometry.cs
- TextContainerChangedEventArgs.cs
- SynchronizedKeyedCollection.cs
- SoundPlayerAction.cs
- TextEditorTables.cs
- WebScriptEnablingBehavior.cs
- OneOf.cs
- BooleanProjectedSlot.cs
- FormsAuthenticationTicket.cs
- NamedElement.cs
- StreamReader.cs
- DataGridViewTextBoxColumn.cs
- Interfaces.cs
- DataGridViewSelectedRowCollection.cs
- CanExecuteRoutedEventArgs.cs
- ProtocolViolationException.cs
- BrowserInteropHelper.cs
- StringUtil.cs
- StyleSheetRefUrlEditor.cs
- XamlTreeBuilder.cs
- SqlNodeAnnotation.cs
- TransactionScope.cs
- HMACMD5.cs
- AttachedPropertyMethodSelector.cs
- ImageListStreamer.cs
- OleDbPropertySetGuid.cs
- WebPartHeaderCloseVerb.cs
- SessionEndingCancelEventArgs.cs
- XmlCompatibilityReader.cs