Code:
/ FX-1434 / FX-1434 / 1.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
- _SpnDictionary.cs
- Helpers.cs
- BatchStream.cs
- PackageStore.cs
- HandledMouseEvent.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ThemeDirectoryCompiler.cs
- ToolStripDropDownButton.cs
- WebPartExportVerb.cs
- DispatchChannelSink.cs
- TextMetrics.cs
- XPathDocumentBuilder.cs
- MetadataItemEmitter.cs
- Model3DGroup.cs
- BufferAllocator.cs
- HMACRIPEMD160.cs
- QueryResult.cs
- StackSpiller.Bindings.cs
- DataListGeneralPage.cs
- BitmapImage.cs
- CodeChecksumPragma.cs
- GridPatternIdentifiers.cs
- EventHandlersStore.cs
- SqlNodeAnnotations.cs
- HMACRIPEMD160.cs
- SystemInformation.cs
- Roles.cs
- SapiRecognizer.cs
- ConfigXmlSignificantWhitespace.cs
- SvcMapFile.cs
- AnnotationAuthorChangedEventArgs.cs
- XmlNodeReader.cs
- MultiDataTrigger.cs
- ContainerSelectorGlyph.cs
- LinkTarget.cs
- BasicHttpMessageSecurity.cs
- UInt64Converter.cs
- Package.cs
- SqlConnectionFactory.cs
- CodeCatchClauseCollection.cs
- LinearGradientBrush.cs
- ArraySortHelper.cs
- SmtpMail.cs
- EdmProperty.cs
- Decimal.cs
- DataGridRowsPresenter.cs
- TrackingProfileCache.cs
- StaticResourceExtension.cs
- GridViewItemAutomationPeer.cs
- SystemSounds.cs
- OdbcException.cs
- ApplicationInfo.cs
- WsdlParser.cs
- NotifyCollectionChangedEventArgs.cs
- Fonts.cs
- SuppressMessageAttribute.cs
- ExeContext.cs
- TiffBitmapDecoder.cs
- BaseAppDomainProtocolHandler.cs
- NTAccount.cs
- OleDbCommandBuilder.cs
- AssemblySettingAttributes.cs
- SafeSecurityHandles.cs
- CopyAttributesAction.cs
- LinqToSqlWrapper.cs
- Model3D.cs
- IDispatchConstantAttribute.cs
- TemplateComponentConnector.cs
- XmlNotation.cs
- XmlSchema.cs
- DefaultCommandConverter.cs
- DataServiceKeyAttribute.cs
- PropertyPathWorker.cs
- _NegoStream.cs
- DoubleLink.cs
- MsmqNonTransactedPoisonHandler.cs
- _LocalDataStore.cs
- FixedTextPointer.cs
- DesignerWidgets.cs
- URLString.cs
- TreeViewItem.cs
- UnmanagedMemoryStreamWrapper.cs
- SerializationAttributes.cs
- IconBitmapDecoder.cs
- FlatButtonAppearance.cs
- JsonDeserializer.cs
- ProxyHwnd.cs
- SoapSchemaImporter.cs
- IndentTextWriter.cs
- isolationinterop.cs
- FontDialog.cs
- MetabaseSettingsIis7.cs
- IList.cs
- BitmapEffectGroup.cs
- SQLMembershipProvider.cs
- GenericTypeParameterBuilder.cs
- DBConcurrencyException.cs
- BitmapSizeOptions.cs
- Configuration.cs
- x509utils.cs