Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebParts / WebPartDescription.cs / 1 / WebPartDescription.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls.WebParts {
using System;
using System.Security.Permissions;
[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class WebPartDescription {
private string _id;
private string _title;
private string _description;
private string _imageUrl;
private WebPart _part;
private WebPartDescription() {
}
public WebPartDescription(string id, string title, string description, string imageUrl) {
if (String.IsNullOrEmpty(id)) {
throw new ArgumentNullException("id");
}
if (String.IsNullOrEmpty(title)) {
throw new ArgumentNullException("title");
}
_id = id;
_title = title;
_description = (description != null) ? description : String.Empty;
_imageUrl = (imageUrl != null) ? imageUrl : String.Empty;
}
public WebPartDescription(WebPart part) {
string id = part.ID;
if (String.IsNullOrEmpty(id)) {
throw new ArgumentException(SR.GetString(SR.WebPartManager_NoWebPartID), "part");
}
_id = id;
string displayTitle = part.DisplayTitle;
_title = (displayTitle != null) ? displayTitle : String.Empty;
string description = part.Description;
_description = (description != null) ? description : String.Empty;
string imageUrl = part.CatalogIconImageUrl;
_imageUrl = (imageUrl != null) ? imageUrl : String.Empty;
_part = part;
}
public string CatalogIconImageUrl {
get {
return _imageUrl;
}
}
public string Description {
get {
return _description;
}
}
public string ID {
get {
return _id;
}
}
public string Title {
get {
return _title;
}
}
internal WebPart WebPart {
get {
return _part;
}
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AudioSignalProblemOccurredEventArgs.cs
- Encoder.cs
- Pens.cs
- Int16AnimationBase.cs
- TrayIconDesigner.cs
- ResourceReader.cs
- codemethodreferenceexpression.cs
- DataGridViewCellStateChangedEventArgs.cs
- CompModSwitches.cs
- TimeZone.cs
- DataServiceClientException.cs
- SiteMapNode.cs
- InheritanceContextChangedEventManager.cs
- SafeProcessHandle.cs
- ColorConverter.cs
- FilterQueryOptionExpression.cs
- MethodInfo.cs
- PropertyGridEditorPart.cs
- SafeArrayTypeMismatchException.cs
- Control.cs
- BitmapPalette.cs
- UrlMapping.cs
- ComboBox.cs
- SqlTopReducer.cs
- ValidatorCollection.cs
- ConstantCheck.cs
- StorageBasedPackageProperties.cs
- ButtonField.cs
- ContainsRowNumberChecker.cs
- Block.cs
- HandleCollector.cs
- SqlUDTStorage.cs
- _StreamFramer.cs
- PtsHost.cs
- LinkLabel.cs
- FigureParagraph.cs
- SecurityContext.cs
- RegisteredExpandoAttribute.cs
- CollectionContainer.cs
- ScrollProviderWrapper.cs
- odbcmetadatafactory.cs
- DataGridParentRows.cs
- Symbol.cs
- SmtpNtlmAuthenticationModule.cs
- InstanceOwnerQueryResult.cs
- CalendarAutomationPeer.cs
- TreeNodeCollectionEditorDialog.cs
- CacheRequest.cs
- Effect.cs
- ZipIOCentralDirectoryFileHeader.cs
- GridSplitterAutomationPeer.cs
- SmiRequestExecutor.cs
- ContentType.cs
- EntityDataSourceConfigureObjectContext.cs
- XmlTextReaderImplHelpers.cs
- CacheAxisQuery.cs
- ClientSettings.cs
- OutputScopeManager.cs
- Enumerable.cs
- TabletDevice.cs
- util.cs
- _NetworkingPerfCounters.cs
- PerspectiveCamera.cs
- SafeNativeMethods.cs
- EmbossBitmapEffect.cs
- HwndProxyElementProvider.cs
- WebPart.cs
- UIInitializationException.cs
- PeerNameRegistration.cs
- Delegate.cs
- XmlDataSourceNodeDescriptor.cs
- XMLSchema.cs
- CellParagraph.cs
- UnaryNode.cs
- LogSwitch.cs
- ExpressionBuilder.cs
- ResourceSetExpression.cs
- SQLBinaryStorage.cs
- FtpRequestCacheValidator.cs
- DbConnectionStringBuilder.cs
- FamilyTypeface.cs
- UnsafeNativeMethods.cs
- MultiDataTrigger.cs
- CheckBoxAutomationPeer.cs
- UIHelper.cs
- ServiceReference.cs
- IndexedGlyphRun.cs
- ListenerUnsafeNativeMethods.cs
- DSACryptoServiceProvider.cs
- OrderedDictionary.cs
- RecordBuilder.cs
- HtmlInputText.cs
- HMACRIPEMD160.cs
- XMLDiffLoader.cs
- _Rfc2616CacheValidators.cs
- ErrorFormatter.cs
- CompiledQuery.cs
- LineServicesRun.cs
- COM2PropertyBuilderUITypeEditor.cs
- StreamGeometryContext.cs