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
- Perspective.cs
- ResourceManagerWrapper.cs
- PageBuildProvider.cs
- FixedPageStructure.cs
- DataGridViewTextBoxColumn.cs
- JournalEntry.cs
- IntAverageAggregationOperator.cs
- Geometry3D.cs
- WebBrowser.cs
- ScriptResourceInfo.cs
- ThaiBuddhistCalendar.cs
- FormDesigner.cs
- URLString.cs
- SafeCryptContextHandle.cs
- FunctionDescription.cs
- SafeCryptoKeyHandle.cs
- PartialClassGenerationTask.cs
- PassportPrincipal.cs
- SimplePropertyEntry.cs
- UnsafeNativeMethods.cs
- SoapIncludeAttribute.cs
- UnsafeMethods.cs
- SubclassTypeValidatorAttribute.cs
- Column.cs
- SelectorAutomationPeer.cs
- ProcessInfo.cs
- DocumentViewerAutomationPeer.cs
- RichTextBoxConstants.cs
- ellipse.cs
- MenuItemCollection.cs
- RijndaelManaged.cs
- ColorDialog.cs
- ImageListUtils.cs
- DataControlFieldCell.cs
- UniqueID.cs
- DataGridAddNewRow.cs
- CredentialCache.cs
- SystemColors.cs
- DataPager.cs
- StructuredType.cs
- Quaternion.cs
- QuaternionKeyFrameCollection.cs
- AppLevelCompilationSectionCache.cs
- HuffModule.cs
- ImageButton.cs
- BaseTemplateCodeDomTreeGenerator.cs
- ToolStripSeparatorRenderEventArgs.cs
- TextEditorContextMenu.cs
- HiddenFieldPageStatePersister.cs
- ParseNumbers.cs
- TabControlAutomationPeer.cs
- TextReader.cs
- AutomationElementCollection.cs
- PointHitTestResult.cs
- FrameworkPropertyMetadata.cs
- CallId.cs
- DiscoveryClientBindingElement.cs
- ScrollEventArgs.cs
- X509AsymmetricSecurityKey.cs
- GridViewCancelEditEventArgs.cs
- CompoundFileReference.cs
- AttributeQuery.cs
- ComponentFactoryHelpers.cs
- DeviceFiltersSection.cs
- RemoteWebConfigurationHostStream.cs
- FastEncoderWindow.cs
- bindurihelper.cs
- CommandBinding.cs
- MeshGeometry3D.cs
- RSAOAEPKeyExchangeFormatter.cs
- AttributeTableBuilder.cs
- ButtonFlatAdapter.cs
- MenuScrollingVisibilityConverter.cs
- MappingException.cs
- NotFiniteNumberException.cs
- KeyConstraint.cs
- TextServicesDisplayAttribute.cs
- TimeSpanParse.cs
- WebPartAuthorizationEventArgs.cs
- CompressionTransform.cs
- ConnectionPoint.cs
- XmlDownloadManager.cs
- ClientOptions.cs
- MimeReturn.cs
- WinEventWrap.cs
- GridViewHeaderRowPresenter.cs
- DiscoveryClientChannelBase.cs
- StoreItemCollection.cs
- FunctionQuery.cs
- DesignerTextBoxAdapter.cs
- TextCharacters.cs
- InvalidDocumentContentsException.cs
- _LocalDataStoreMgr.cs
- ClientFormsIdentity.cs
- BuildResult.cs
- PointConverter.cs
- ProxyAttribute.cs
- DictionaryChange.cs
- Metafile.cs
- SspiNegotiationTokenAuthenticator.cs