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
- PagerStyle.cs
- ErrorHandler.cs
- XmlNodeReader.cs
- UnmanagedMemoryStreamWrapper.cs
- _ProxyRegBlob.cs
- ComboBoxAutomationPeer.cs
- MatchingStyle.cs
- SignatureConfirmations.cs
- _IPv6Address.cs
- MeasureData.cs
- path.cs
- PictureBoxDesigner.cs
- ObjectSecurity.cs
- ToolStripRenderEventArgs.cs
- OutArgument.cs
- ToolStripScrollButton.cs
- PersonalizableTypeEntry.cs
- DataServiceQueryProvider.cs
- OdbcHandle.cs
- Random.cs
- DataRowComparer.cs
- LiteralControl.cs
- PreviewPageInfo.cs
- XmlSerializerFactory.cs
- ClientScriptManagerWrapper.cs
- XmlKeywords.cs
- MimePart.cs
- UpDownBase.cs
- IResourceProvider.cs
- TemplateControlBuildProvider.cs
- HttpCookie.cs
- StylusShape.cs
- FtpRequestCacheValidator.cs
- View.cs
- PopupRoot.cs
- _PooledStream.cs
- ArrayList.cs
- Crypto.cs
- ImpersonateTokenRef.cs
- XmlSchemaParticle.cs
- NetSectionGroup.cs
- SqlDuplicator.cs
- TypeSemantics.cs
- XhtmlConformanceSection.cs
- ParallelDesigner.cs
- ClientConvert.cs
- Pen.cs
- Propagator.cs
- SqlInternalConnectionSmi.cs
- DBParameter.cs
- ErrorItem.cs
- CharEntityEncoderFallback.cs
- MethodBuilder.cs
- CustomCredentialPolicy.cs
- StackSpiller.cs
- TextEditor.cs
- CallId.cs
- DataColumnMappingCollection.cs
- _SSPISessionCache.cs
- SourceFileInfo.cs
- ReservationCollection.cs
- UndoManager.cs
- JsonDataContract.cs
- WindowsEditBoxRange.cs
- PackageFilter.cs
- DataSetSchema.cs
- UrlPath.cs
- ImageSource.cs
- AdornedElementPlaceholder.cs
- SessionStateContainer.cs
- ConsumerConnectionPointCollection.cs
- SchemaElementDecl.cs
- DropDownList.cs
- DataSvcMapFileSerializer.cs
- ToolStripArrowRenderEventArgs.cs
- FormViewPagerRow.cs
- PackageRelationshipSelector.cs
- dataSvcMapFileLoader.cs
- PropertyMappingExceptionEventArgs.cs
- MissingManifestResourceException.cs
- Propagator.Evaluator.cs
- BinaryNode.cs
- CellTreeNodeVisitors.cs
- RelationshipFixer.cs
- Rijndael.cs
- RemotingException.cs
- MailSettingsSection.cs
- IItemContainerGenerator.cs
- IPCCacheManager.cs
- SubMenuStyleCollection.cs
- Int32CollectionValueSerializer.cs
- DateTimeSerializationSection.cs
- MetadataUtil.cs
- TabItem.cs
- RequestCachePolicyConverter.cs
- FileIOPermission.cs
- dsa.cs
- CodeMethodMap.cs
- AnimationLayer.cs
- SmiConnection.cs