Code:
/ DotNET / DotNET / 8.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
- EFTableProvider.cs
- QilValidationVisitor.cs
- FormsIdentity.cs
- ScrollViewer.cs
- AesCryptoServiceProvider.cs
- Instrumentation.cs
- NamespaceCollection.cs
- WCFBuildProvider.cs
- WindowsSolidBrush.cs
- SequenceDesigner.cs
- PropertyTabAttribute.cs
- PatternMatchRules.cs
- OptionalColumn.cs
- TextRunCacheImp.cs
- DataBinder.cs
- DataSet.cs
- SchemaTableOptionalColumn.cs
- BrowserCapabilitiesFactoryBase.cs
- shaperfactoryquerycacheentry.cs
- embossbitmapeffect.cs
- VSWCFServiceContractGenerator.cs
- Operand.cs
- ActivationServices.cs
- Validator.cs
- FileSystemEventArgs.cs
- DbParameterHelper.cs
- EntityDataSourceQueryBuilder.cs
- KeyValueConfigurationCollection.cs
- HwndStylusInputProvider.cs
- AudioDeviceOut.cs
- DataGridSortCommandEventArgs.cs
- HashCryptoHandle.cs
- QuotedStringFormatReader.cs
- SortedList.cs
- PeerApplicationLaunchInfo.cs
- SqlDataReaderSmi.cs
- Schedule.cs
- MailWriter.cs
- DragSelectionMessageFilter.cs
- NativeMethods.cs
- XsdDuration.cs
- Exceptions.cs
- SetterBase.cs
- DbProviderSpecificTypePropertyAttribute.cs
- MSHTMLHost.cs
- ListViewHitTestInfo.cs
- PreviewPrintController.cs
- ToolStripHighContrastRenderer.cs
- StoreItemCollection.cs
- InputProviderSite.cs
- RpcResponse.cs
- ReaderWriterLockSlim.cs
- EntityKeyElement.cs
- XmlEntityReference.cs
- PathGradientBrush.cs
- BypassElement.cs
- HTMLTagNameToTypeMapper.cs
- dsa.cs
- SingleStorage.cs
- DateTimePicker.cs
- ListViewAutomationPeer.cs
- MediaPlayer.cs
- ProcessHostConfigUtils.cs
- DiscoveryOperationContextExtension.cs
- OdbcDataAdapter.cs
- BufferedGraphicsContext.cs
- DatatypeImplementation.cs
- SurrogateChar.cs
- InvokeBase.cs
- WorkflowInstance.cs
- BroadcastEventHelper.cs
- AccessDataSourceDesigner.cs
- EdmError.cs
- Ipv6Element.cs
- CryptoHandle.cs
- ActivityMarkupSerializer.cs
- EventHandlers.cs
- RadioButton.cs
- EdmValidator.cs
- CultureSpecificStringDictionary.cs
- AsyncPostBackTrigger.cs
- EdmToObjectNamespaceMap.cs
- XPathEmptyIterator.cs
- translator.cs
- BamlLocalizationDictionary.cs
- ContentPresenter.cs
- LocatorManager.cs
- DataGridViewSortCompareEventArgs.cs
- Camera.cs
- SchemaTableColumn.cs
- OleServicesContext.cs
- MediaTimeline.cs
- SqlFunctionAttribute.cs
- FrameworkElementFactoryMarkupObject.cs
- XmlReturnWriter.cs
- DrawListViewColumnHeaderEventArgs.cs
- MimeImporter.cs
- FontSource.cs
- OSFeature.cs
- SiteOfOriginPart.cs