Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / PersistenceTypeAttribute.cs / 1305376 / PersistenceTypeAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI {
using System.Runtime.InteropServices;
using System;
using System.ComponentModel;
///
/// LiteralContentAttribute indicates whether the contents within a tag representing
/// a custom/web control should be treated by Trident as a "literal/text" content.
/// Web controls supporting complex properties (like Templates, etc.) typically
/// mark themselves as "literals", thereby letting the designer infra-structure
/// and Trident deal with the persistence of those attributes.
///
/// If LiteralContentAttribute.No is present or no LiteralContentAttribute marking
/// exists, then the tag corresponding to the web control is not treated as a literal
/// content tag.
/// If LiteralContentAttribute.Yes is present, then the tag corresponding to the web
/// control is treated as a literal content tag.
///
[AttributeUsage(AttributeTargets.All)]
public sealed class PersistenceModeAttribute : Attribute {
///
/// This marks a property or event as persistable in the HTML tag as an attribute.
///
public static readonly PersistenceModeAttribute Attribute = new PersistenceModeAttribute(PersistenceMode.Attribute);
///
/// This marks a property or event as persistable within the HTML tag as a nested tag.
///
public static readonly PersistenceModeAttribute InnerProperty = new PersistenceModeAttribute(PersistenceMode.InnerProperty);
///
/// This marks a property or event as persistable within the HTML tag as a child.
///
public static readonly PersistenceModeAttribute InnerDefaultProperty = new PersistenceModeAttribute(PersistenceMode.InnerDefaultProperty);
///
/// This marks a property or event as persistable within the HTML tag as a child.
///
public static readonly PersistenceModeAttribute EncodedInnerDefaultProperty = new PersistenceModeAttribute(PersistenceMode.EncodedInnerDefaultProperty);
///
///
public static readonly PersistenceModeAttribute Default = Attribute;
private PersistenceMode mode = PersistenceMode.Attribute;
///
public PersistenceModeAttribute(PersistenceMode mode) {
if (mode < PersistenceMode.Attribute || mode > PersistenceMode.EncodedInnerDefaultProperty) {
throw new ArgumentOutOfRangeException("mode");
}
this.mode = mode;
}
///
///
public PersistenceMode Mode {
get {
return mode;
}
}
///
public override int GetHashCode() {
return Mode.GetHashCode();
}
///
///
///
public override bool Equals(object obj) {
if (obj == this) {
return true;
}
if ((obj != null) && (obj is PersistenceModeAttribute)) {
return((PersistenceModeAttribute)obj).Mode == mode;
}
return false;
}
///
///
///
public override bool IsDefaultAttribute() {
return this.Equals(Default);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DigitShape.cs
- MSG.cs
- ReferenceConverter.cs
- TimeManager.cs
- List.cs
- UshortList2.cs
- Pair.cs
- PerformanceCountersBase.cs
- DataListGeneralPage.cs
- WebPartDescriptionCollection.cs
- Literal.cs
- Oid.cs
- DateTimeFormatInfo.cs
- CodeDefaultValueExpression.cs
- ConstructorExpr.cs
- Inline.cs
- TransactionChannel.cs
- OleDbMetaDataFactory.cs
- securestring.cs
- ConfigXmlElement.cs
- WebPartEditorOkVerb.cs
- TransformCollection.cs
- DefaultBinder.cs
- EmptyQuery.cs
- ComplexBindingPropertiesAttribute.cs
- __ComObject.cs
- TypeUsage.cs
- LZCodec.cs
- StylusPlugInCollection.cs
- ICspAsymmetricAlgorithm.cs
- FormsAuthenticationConfiguration.cs
- UriWriter.cs
- WebBrowserHelper.cs
- RSACryptoServiceProvider.cs
- AutomationPropertyChangedEventArgs.cs
- PriorityQueue.cs
- DataContract.cs
- NamedPipeHostedTransportConfiguration.cs
- CfgArc.cs
- ActivityCollectionMarkupSerializer.cs
- JsonUriDataContract.cs
- ParseNumbers.cs
- Triangle.cs
- DataObjectPastingEventArgs.cs
- IdentitySection.cs
- LambdaCompiler.cs
- remotingproxy.cs
- XmlDownloadManager.cs
- MessageVersion.cs
- ExternalCalls.cs
- TraceContextEventArgs.cs
- PanelStyle.cs
- FamilyMap.cs
- FullTrustAssembly.cs
- HTTPNotFoundHandler.cs
- DataSourceControlBuilder.cs
- MobileControlsSectionHelper.cs
- ConfigurationStrings.cs
- StringUtil.cs
- ProxyWebPartManager.cs
- CompilerResults.cs
- OdbcConnectionString.cs
- PeerObject.cs
- CompositeCollectionView.cs
- DispatcherSynchronizationContext.cs
- WebPartConnectionsDisconnectVerb.cs
- SafeNativeMethods.cs
- XmlExtensionFunction.cs
- RectangleHotSpot.cs
- CodeNamespaceImportCollection.cs
- MarginsConverter.cs
- DrawListViewSubItemEventArgs.cs
- OleDbConnection.cs
- ImageList.cs
- SerializerProvider.cs
- PrintEvent.cs
- WindowsTitleBar.cs
- WizardPanelChangingEventArgs.cs
- DynamicValidatorEventArgs.cs
- EventMappingSettings.cs
- CancelAsyncOperationRequest.cs
- MemoryStream.cs
- ExpressionWriter.cs
- XmlArrayItemAttribute.cs
- SystemIPGlobalProperties.cs
- XhtmlBasicCalendarAdapter.cs
- TextFindEngine.cs
- EventPropertyMap.cs
- DataSourceXmlElementAttribute.cs
- CryptoKeySecurity.cs
- DataServiceRequestException.cs
- EntityDataSourceConfigureObjectContext.cs
- RIPEMD160.cs
- TypedDataSourceCodeGenerator.cs
- SoapElementAttribute.cs
- DbMetaDataColumnNames.cs
- UnmanagedMarshal.cs
- MergePropertyDescriptor.cs
- shaperfactory.cs
- KeySplineConverter.cs