Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ // // 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
- SqlStream.cs
- OdbcParameter.cs
- ExpressionDumper.cs
- StringResourceManager.cs
- UTF8Encoding.cs
- InstanceData.cs
- TileBrush.cs
- WebControlsSection.cs
- SafeNativeMethods.cs
- CapabilitiesUse.cs
- BookmarkResumptionRecord.cs
- ScriptResourceInfo.cs
- ScriptModule.cs
- ToolboxBitmapAttribute.cs
- Configuration.cs
- WebPartTransformerAttribute.cs
- RIPEMD160Managed.cs
- SignatureDescription.cs
- UnauthorizedWebPart.cs
- WeakEventManager.cs
- ICspAsymmetricAlgorithm.cs
- HMACSHA256.cs
- XmlAttributeCollection.cs
- XmlUtil.cs
- InputMethodStateChangeEventArgs.cs
- _ChunkParse.cs
- TripleDESCryptoServiceProvider.cs
- ApplicationId.cs
- RootBrowserWindowProxy.cs
- Visitors.cs
- CacheHelper.cs
- ControlAdapter.cs
- TextSpanModifier.cs
- sqlnorm.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- TextComposition.cs
- ByteStorage.cs
- XmlText.cs
- FileDialogPermission.cs
- UrlParameterReader.cs
- TransportationConfigurationTypeInstallComponent.cs
- UpdateException.cs
- ManagedFilter.cs
- SemanticAnalyzer.cs
- MyContact.cs
- WindowsStatusBar.cs
- TextEffect.cs
- UInt64.cs
- XmlNavigatorFilter.cs
- MetadataCollection.cs
- ScrollChrome.cs
- Soap12FormatExtensions.cs
- RequestCachingSection.cs
- ChannelManager.cs
- DataBindEngine.cs
- FullTextState.cs
- StructuralType.cs
- EventProviderBase.cs
- GridItemCollection.cs
- ThemeDirectoryCompiler.cs
- DataTableCollection.cs
- PageHandlerFactory.cs
- ExpressionEditorAttribute.cs
- ZipPackagePart.cs
- JsonReader.cs
- TargetInvocationException.cs
- HtmlTextArea.cs
- DataGridViewComboBoxColumn.cs
- FixedTextBuilder.cs
- Timeline.cs
- PerfCounters.cs
- TextDecorationCollection.cs
- WebUtil.cs
- SamlSecurityTokenAuthenticator.cs
- HiddenFieldPageStatePersister.cs
- AccessKeyManager.cs
- CodeNamespace.cs
- PageTextBox.cs
- LoginUtil.cs
- RestClientProxyHandler.cs
- UInt32.cs
- FlowPosition.cs
- ThemeDirectoryCompiler.cs
- Messages.cs
- ForceCopyBuildProvider.cs
- StructuredType.cs
- CalendarButton.cs
- DataSetUtil.cs
- SurrogateDataContract.cs
- WebPartCollection.cs
- Wildcard.cs
- ScopelessEnumAttribute.cs
- IDictionary.cs
- IPHostEntry.cs
- mediapermission.cs
- ProbeDuplex11AsyncResult.cs
- shaperfactoryquerycachekey.cs
- RelationshipConstraintValidator.cs
- ErrorEventArgs.cs
- Rijndael.cs