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
- XmlNamedNodeMap.cs
- AuditLevel.cs
- ServiceContractViewControl.cs
- ArrayWithOffset.cs
- FlagsAttribute.cs
- DbConnectionPoolCounters.cs
- UserControl.cs
- MetadataCacheItem.cs
- InsufficientMemoryException.cs
- SqlMultiplexer.cs
- ServiceMoniker.cs
- EntitySetBaseCollection.cs
- ItemDragEvent.cs
- SplitterPanel.cs
- InternalsVisibleToAttribute.cs
- UpdateCommandGenerator.cs
- WebBrowserSiteBase.cs
- SafeFileHandle.cs
- odbcmetadatacolumnnames.cs
- XmlReflectionImporter.cs
- IdentitySection.cs
- SystemResourceKey.cs
- XmlIncludeAttribute.cs
- TemplateBindingExpression.cs
- ListViewDeletedEventArgs.cs
- _ConnectStream.cs
- TreeViewImageIndexConverter.cs
- DateTimeSerializationSection.cs
- SerializationException.cs
- SqlOuterApplyReducer.cs
- Authorization.cs
- OdbcFactory.cs
- CodeDirectiveCollection.cs
- SafeRegistryKey.cs
- TimersDescriptionAttribute.cs
- ProtocolsConfigurationEntry.cs
- RotateTransform3D.cs
- XmlSchemaSubstitutionGroup.cs
- InputLanguageProfileNotifySink.cs
- SoapHeaderAttribute.cs
- GridViewUpdateEventArgs.cs
- Size3DConverter.cs
- columnmapfactory.cs
- MenuItemStyleCollection.cs
- Compiler.cs
- CellPartitioner.cs
- Object.cs
- IntSecurity.cs
- HttpStreamFormatter.cs
- CmsUtils.cs
- ToolboxItemFilterAttribute.cs
- DefaultEventAttribute.cs
- PreservationFileReader.cs
- SQLDouble.cs
- XmlNodeList.cs
- FlowDocument.cs
- WebMessageEncodingElement.cs
- CompilerState.cs
- VideoDrawing.cs
- SourceFileBuildProvider.cs
- SessionEndingEventArgs.cs
- DbFunctionCommandTree.cs
- SqlHelper.cs
- FormViewRow.cs
- ConcurrentBag.cs
- Variant.cs
- PartBasedPackageProperties.cs
- GridViewRowPresenterBase.cs
- XmlAggregates.cs
- SafeThreadHandle.cs
- LinkAreaEditor.cs
- TableChangeProcessor.cs
- SourceSwitch.cs
- ListComponentEditor.cs
- ContentControl.cs
- PagesChangedEventArgs.cs
- DataGridViewAccessibleObject.cs
- UIElement3DAutomationPeer.cs
- EncryptedXml.cs
- MemberCollection.cs
- wgx_exports.cs
- path.cs
- XdrBuilder.cs
- ConstructorNeedsTagAttribute.cs
- TreeNodeMouseHoverEvent.cs
- InheritanceRules.cs
- OrderedDictionaryStateHelper.cs
- TraceSection.cs
- MultiBindingExpression.cs
- TextServicesProperty.cs
- FileSecurity.cs
- PasswordRecovery.cs
- TextTreeFixupNode.cs
- PolyQuadraticBezierSegment.cs
- PatternMatcher.cs
- StateBag.cs
- _NegoStream.cs
- InternalDuplexChannelListener.cs
- XmlSchemaGroupRef.cs
- WindowsAuthenticationModule.cs