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
- CodeMethodReturnStatement.cs
- CodeNamespace.cs
- LambdaCompiler.Binary.cs
- GcHandle.cs
- Int32CAMarshaler.cs
- QilGeneratorEnv.cs
- UniqueEventHelper.cs
- TaskDesigner.cs
- XamlSerializerUtil.cs
- LockedHandleGlyph.cs
- IntPtr.cs
- TextBlock.cs
- GridViewUpdatedEventArgs.cs
- LiteralText.cs
- ImagingCache.cs
- ProviderCommandInfoUtils.cs
- SettingsPropertyNotFoundException.cs
- SpeechDetectedEventArgs.cs
- DbModificationClause.cs
- NameValuePermission.cs
- BamlLocalizabilityResolver.cs
- StringDictionary.cs
- BooleanToVisibilityConverter.cs
- WebPartActionVerb.cs
- VectorCollection.cs
- COMException.cs
- UnsafeNativeMethodsMilCoreApi.cs
- AssertUtility.cs
- RoutedPropertyChangedEventArgs.cs
- PointValueSerializer.cs
- DesignerVerb.cs
- SiteMapHierarchicalDataSourceView.cs
- Dump.cs
- SqlClientWrapperSmiStream.cs
- ToolboxCategory.cs
- TextServicesCompartmentContext.cs
- ArrangedElement.cs
- ArraySortHelper.cs
- RenderingEventArgs.cs
- ObjectIDGenerator.cs
- AxisAngleRotation3D.cs
- KeyNotFoundException.cs
- versioninfo.cs
- PassportIdentity.cs
- XpsFontSubsetter.cs
- XmlChildEnumerator.cs
- CultureInfoConverter.cs
- XMLUtil.cs
- ParallelQuery.cs
- PageTheme.cs
- UdpTransportSettingsElement.cs
- ResourceContainer.cs
- ProtectedProviderSettings.cs
- OdbcDataReader.cs
- TypedAsyncResult.cs
- BindingWorker.cs
- SafeCertificateContext.cs
- NotifyParentPropertyAttribute.cs
- CategoryList.cs
- TiffBitmapEncoder.cs
- SplitContainer.cs
- _Events.cs
- CompressionTracing.cs
- SvcFileManager.cs
- ApplicationException.cs
- HtmlDocument.cs
- GridErrorDlg.cs
- RenderingEventArgs.cs
- DesignerTransaction.cs
- TaskScheduler.cs
- RunClient.cs
- OrderedEnumerableRowCollection.cs
- Table.cs
- EventLogRecord.cs
- RichTextBoxDesigner.cs
- ObfuscateAssemblyAttribute.cs
- XmlValidatingReaderImpl.cs
- SpAudioStreamWrapper.cs
- WsdlBuildProvider.cs
- Frame.cs
- GlyphRunDrawing.cs
- BitConverter.cs
- _AutoWebProxyScriptWrapper.cs
- ConfigXmlText.cs
- SecurityHelper.cs
- DelegatedStream.cs
- SchemaDeclBase.cs
- CombinedGeometry.cs
- EdgeProfileValidation.cs
- CompilerScopeManager.cs
- XmlAtomicValue.cs
- WebPartCollection.cs
- StylusButtonCollection.cs
- NumericUpDownAcceleration.cs
- PeerObject.cs
- RawKeyboardInputReport.cs
- EncodingDataItem.cs
- RegexCode.cs
- GlobalEventManager.cs
- DoubleStorage.cs