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
- BufferAllocator.cs
- ParsedAttributeCollection.cs
- ManagementObjectCollection.cs
- XmlUnspecifiedAttribute.cs
- DynamicValueConverter.cs
- MediaElementAutomationPeer.cs
- SiteMapNode.cs
- TransactionScope.cs
- BindingValueChangedEventArgs.cs
- RadioButtonList.cs
- CompilerGlobalScopeAttribute.cs
- ADConnectionHelper.cs
- SendSecurityHeader.cs
- SamlAuthorizationDecisionStatement.cs
- FixedSOMGroup.cs
- TableLayoutSettings.cs
- DeviceSpecificChoiceCollection.cs
- EntityDataSourceView.cs
- Pen.cs
- XmlSchemaAny.cs
- SqlMetaData.cs
- SerTrace.cs
- DnsPermission.cs
- PropertyPathConverter.cs
- DeobfuscatingStream.cs
- SR.cs
- LayoutDump.cs
- AddressAccessDeniedException.cs
- DrawingContextDrawingContextWalker.cs
- DesignerAttribute.cs
- JsonServiceDocumentSerializer.cs
- elementinformation.cs
- SpeechSynthesizer.cs
- Int32RectConverter.cs
- SimpleType.cs
- dbdatarecord.cs
- FrameworkTemplate.cs
- QueryExtender.cs
- ExternalException.cs
- GrammarBuilder.cs
- EntityWithChangeTrackerStrategy.cs
- XmlNodeChangedEventManager.cs
- JsonWriterDelegator.cs
- BindingMAnagerBase.cs
- DynamicPropertyReader.cs
- SmtpReplyReaderFactory.cs
- ToolStripContextMenu.cs
- ThrowHelper.cs
- LicenseProviderAttribute.cs
- ArgumentOutOfRangeException.cs
- EncryptedData.cs
- TypeConverterHelper.cs
- PriorityQueue.cs
- FtpWebRequest.cs
- ShaderRenderModeValidation.cs
- Label.cs
- TextDocumentView.cs
- CompiledELinqQueryState.cs
- WorkflowDispatchContext.cs
- XmlNullResolver.cs
- OrderByQueryOptionExpression.cs
- XmlAutoDetectWriter.cs
- COAUTHIDENTITY.cs
- TreeNodeBinding.cs
- WebConfigurationFileMap.cs
- ComponentRenameEvent.cs
- WorkflowTransactionService.cs
- XmlSchemaObjectCollection.cs
- NativeMethods.cs
- ContainerSelectorBehavior.cs
- IDataContractSurrogate.cs
- PartialTrustVisibleAssemblyCollection.cs
- SocketException.cs
- GridViewUpdatedEventArgs.cs
- XmlSignificantWhitespace.cs
- PauseStoryboard.cs
- ExtendedProtectionPolicy.cs
- HttpPostedFile.cs
- WebPartVerbCollection.cs
- XPathNavigator.cs
- SoapSchemaExporter.cs
- AuthenticationModulesSection.cs
- OpacityConverter.cs
- OneOfTypeConst.cs
- SqlDataSource.cs
- ReferenceSchema.cs
- ColumnHeaderConverter.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- PersonalizationStateInfoCollection.cs
- CodeIndexerExpression.cs
- MailWebEventProvider.cs
- HttpCacheVaryByContentEncodings.cs
- FormatterServices.cs
- OciLobLocator.cs
- LayoutTableCell.cs
- WebPartVerb.cs
- RawKeyboardInputReport.cs
- RichListBox.cs
- SerializationInfoEnumerator.cs
- TextPenaltyModule.cs