Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebParts / DeclarativeCatalogPartDesigner.cs / 1 / DeclarativeCatalogPartDesigner.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls.WebParts { using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Design; 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)] public class DeclarativeCatalogPartDesigner : CatalogPartDesigner { private const string templateName = "WebPartsTemplate"; private DeclarativeCatalogPart _catalogPart; private TemplateGroup _templateGroup; public override TemplateGroupCollection TemplateGroups { get { TemplateGroupCollection groups = base.TemplateGroups; if (_templateGroup == null) { _templateGroup = new TemplateGroup(templateName, _catalogPart.ControlStyle); _templateGroup.AddTemplateDefinition(new TemplateDefinition(this, templateName, _catalogPart, templateName, _catalogPart.ControlStyle)); } groups.Add(_templateGroup); return groups; } } public override string GetDesignTimeHtml() { if (!(_catalogPart.Parent is CatalogZoneBase)) { return CreateInvalidParentDesignTimeHtml(typeof(CatalogPart), typeof(CatalogZoneBase)); } string designTimeHtml = String.Empty; try { if (((DeclarativeCatalogPart)ViewControl).WebPartsTemplate == null) { designTimeHtml = GetEmptyDesignTimeHtml(); } else { // DeclarativeCatalogPart has no default runtime rendering, so GetDesignTimeHtml() should also // return String.Empty, so we don't get the '[Type "ID"]' rendered in the designer. // designTimeHtml = String.Empty; } } catch (Exception e) { designTimeHtml = GetErrorDesignTimeHtml(e); } return designTimeHtml; } protected override string GetEmptyDesignTimeHtml() { return CreatePlaceHolderDesignTimeHtml(SR.GetString(SR.DeclarativeCatalogPartDesigner_Empty)); } public override void Initialize(IComponent component) { VerifyInitializeArgument(component, typeof(DeclarativeCatalogPart)); base.Initialize(component); _catalogPart = (DeclarativeCatalogPart)component; if (View != null) { View.SetFlags(ViewFlags.TemplateEditing, true); } } } } // 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
- ITreeGenerator.cs
- Cursor.cs
- WaitHandleCannotBeOpenedException.cs
- InkSerializer.cs
- Ops.cs
- FontSizeConverter.cs
- RoutedEventConverter.cs
- DatasetMethodGenerator.cs
- CultureTable.cs
- ScrollChrome.cs
- DbDataReader.cs
- WorkflowViewService.cs
- GeometryConverter.cs
- SimpleHandlerBuildProvider.cs
- Byte.cs
- TextSchema.cs
- BindingList.cs
- FontInfo.cs
- ControlBuilder.cs
- ZoomPercentageConverter.cs
- EffectiveValueEntry.cs
- CapabilitiesAssignment.cs
- EncoderReplacementFallback.cs
- LinqMaximalSubtreeNominator.cs
- SmtpNetworkElement.cs
- ListControlBuilder.cs
- DateTimeFormatInfoScanner.cs
- LocalTransaction.cs
- WizardStepBase.cs
- CompensationHandlingFilter.cs
- RegionIterator.cs
- ViewStateException.cs
- SerializationUtility.cs
- Crypto.cs
- TextBoxDesigner.cs
- BinHexDecoder.cs
- DispatchChannelSink.cs
- TableHeaderCell.cs
- TrackingWorkflowEventArgs.cs
- MappingModelBuildProvider.cs
- ToolStripOverflow.cs
- BufferCache.cs
- KoreanCalendar.cs
- FormatterServices.cs
- _AutoWebProxyScriptWrapper.cs
- ConstraintEnumerator.cs
- SecurityException.cs
- HttpVersion.cs
- MenuItemStyle.cs
- XsltConvert.cs
- TextWriterTraceListener.cs
- XmlSchemaGroup.cs
- HttpCapabilitiesBase.cs
- ScaleTransform.cs
- DependencyPropertyHelper.cs
- InternalDispatchObject.cs
- XmlSchemaAnnotated.cs
- SqlAliasesReferenced.cs
- DeploymentExceptionMapper.cs
- IndentTextWriter.cs
- ControlPropertyNameConverter.cs
- Choices.cs
- LicFileLicenseProvider.cs
- SimpleBitVector32.cs
- DeviceContext2.cs
- GridViewCancelEditEventArgs.cs
- AppliesToBehaviorDecisionTable.cs
- TypedColumnHandler.cs
- DecoderNLS.cs
- _SSPISessionCache.cs
- ToolStripRenderer.cs
- Form.cs
- WorkflowViewStateService.cs
- Matrix.cs
- Label.cs
- TransformerConfigurationWizardBase.cs
- FormatConvertedBitmap.cs
- OpenFileDialog.cs
- StatusBarAutomationPeer.cs
- ByteConverter.cs
- CultureMapper.cs
- XComponentModel.cs
- RoutingSection.cs
- SchemaEntity.cs
- VisualStyleRenderer.cs
- DataTableReader.cs
- UshortList2.cs
- ClientTarget.cs
- GPStream.cs
- WpfPayload.cs
- WebPartEditorOkVerb.cs
- PointKeyFrameCollection.cs
- COM2Enum.cs
- ControlBuilder.cs
- BitmapEffectInput.cs
- RadioButtonStandardAdapter.cs
- ModelFunctionTypeElement.cs
- DoubleAnimationClockResource.cs
- Int32Collection.cs
- RightNameExpirationInfoPair.cs