Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / PersistChildrenAttribute.cs / 1 / PersistChildrenAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.ComponentModel; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.Class)] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class PersistChildrenAttribute : Attribute { ////// Indicates whether /// the contents within a tag representing a custom /// or Web control should be treated as literal text. Web controls supporting complex properties, like /// templates, and /// so on, typically mark themselves as "literals", thereby letting the designer /// infra-structure deal with the persistence of those attributes. ////// public static readonly PersistChildrenAttribute Yes = new PersistChildrenAttribute(true); ///Indicates that the children of a control should be persisted at design-time. /// ////// public static readonly PersistChildrenAttribute No = new PersistChildrenAttribute(false); ///Indicates that the children of a control should not be persisted at design-time. ////// This marks the default child persistence behavior for a control at design time. (equal to Yes.) /// public static readonly PersistChildrenAttribute Default = Yes; private bool _persist; private bool _usesCustomPersistence; ////// public PersistChildrenAttribute(bool persist) { _persist = persist; } public PersistChildrenAttribute(bool persist, bool usesCustomPersistence) : this(persist) { _usesCustomPersistence = usesCustomPersistence; } ////// public bool Persist { get { return _persist; } } ///Indicates whether the children of a control should be persisted at design-time. /// This property is read-only. ////// public bool UsesCustomPersistence { get { // if persist is true, we don't use custom persistence. return !_persist && _usesCustomPersistence; } } ///Indicates whether the control does custom persistence. /// This property is read-only. ////// ///public override int GetHashCode() { return Persist.GetHashCode(); } /// /// ///public override bool Equals(object obj) { if (obj == this) { return true; } if ((obj != null) && (obj is PersistChildrenAttribute)) { return ((PersistChildrenAttribute)obj).Persist == _persist; } 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; using System.ComponentModel; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.Class)] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class PersistChildrenAttribute : Attribute { ////// Indicates whether /// the contents within a tag representing a custom /// or Web control should be treated as literal text. Web controls supporting complex properties, like /// templates, and /// so on, typically mark themselves as "literals", thereby letting the designer /// infra-structure deal with the persistence of those attributes. ////// public static readonly PersistChildrenAttribute Yes = new PersistChildrenAttribute(true); ///Indicates that the children of a control should be persisted at design-time. /// ////// public static readonly PersistChildrenAttribute No = new PersistChildrenAttribute(false); ///Indicates that the children of a control should not be persisted at design-time. ////// This marks the default child persistence behavior for a control at design time. (equal to Yes.) /// public static readonly PersistChildrenAttribute Default = Yes; private bool _persist; private bool _usesCustomPersistence; ////// public PersistChildrenAttribute(bool persist) { _persist = persist; } public PersistChildrenAttribute(bool persist, bool usesCustomPersistence) : this(persist) { _usesCustomPersistence = usesCustomPersistence; } ////// public bool Persist { get { return _persist; } } ///Indicates whether the children of a control should be persisted at design-time. /// This property is read-only. ////// public bool UsesCustomPersistence { get { // if persist is true, we don't use custom persistence. return !_persist && _usesCustomPersistence; } } ///Indicates whether the control does custom persistence. /// This property is read-only. ////// ///public override int GetHashCode() { return Persist.GetHashCode(); } /// /// ///public override bool Equals(object obj) { if (obj == this) { return true; } if ((obj != null) && (obj is PersistChildrenAttribute)) { return ((PersistChildrenAttribute)obj).Persist == _persist; } 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
- ShaderEffect.cs
- EventPropertyMap.cs
- OracleException.cs
- GuidTagList.cs
- AssemblyAssociatedContentFileAttribute.cs
- TypeSemantics.cs
- PolyBezierSegment.cs
- ListDictionary.cs
- FamilyTypefaceCollection.cs
- TimelineClockCollection.cs
- DataSourceHelper.cs
- DesignerAutoFormat.cs
- CommandID.cs
- isolationinterop.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- PanelDesigner.cs
- MultiView.cs
- DependencyProperty.cs
- FormatException.cs
- EntitySqlException.cs
- ScriptComponentDescriptor.cs
- XmlAggregates.cs
- ConfigurationSection.cs
- TypeGenericEnumerableViewSchema.cs
- RSAPKCS1SignatureFormatter.cs
- TableNameAttribute.cs
- BadImageFormatException.cs
- List.cs
- ResourceSet.cs
- MediaSystem.cs
- GridPatternIdentifiers.cs
- DrawingImage.cs
- ErrorRuntimeConfig.cs
- ValidationHelpers.cs
- MatcherBuilder.cs
- TypeUsage.cs
- Tile.cs
- GridItemProviderWrapper.cs
- _Connection.cs
- XmlCDATASection.cs
- DataError.cs
- PointConverter.cs
- SafeViewOfFileHandle.cs
- UInt32Storage.cs
- OperandQuery.cs
- FormatConvertedBitmap.cs
- BitmapData.cs
- CacheEntry.cs
- StandardBindingElement.cs
- QueryCacheManager.cs
- ValidatorCollection.cs
- UniqueEventHelper.cs
- TypeInfo.cs
- SeekStoryboard.cs
- ArithmeticException.cs
- TextEditorTables.cs
- SqlCrossApplyToCrossJoin.cs
- HttpProtocolReflector.cs
- WorkflowRequestContext.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- Fx.cs
- GridView.cs
- DataServiceClientException.cs
- XmlCharCheckingReader.cs
- SoundPlayer.cs
- DockingAttribute.cs
- invalidudtexception.cs
- DrawingImage.cs
- KeyValueInternalCollection.cs
- CompiledQueryCacheEntry.cs
- HandlerFactoryCache.cs
- InstanceDataCollection.cs
- ComponentCommands.cs
- ComponentCache.cs
- WebReferencesBuildProvider.cs
- XmlAggregates.cs
- CorrelationValidator.cs
- MimeParameters.cs
- GridErrorDlg.cs
- XNodeNavigator.cs
- FixedSOMPageConstructor.cs
- Icon.cs
- DbExpressionRules.cs
- RoutedEventHandlerInfo.cs
- ToolStripRendererSwitcher.cs
- WSFederationHttpSecurityElement.cs
- DockProviderWrapper.cs
- SizeConverter.cs
- WebPartExportVerb.cs
- ByeOperation11AsyncResult.cs
- LinqMaximalSubtreeNominator.cs
- BinHexDecoder.cs
- DynamicDataManager.cs
- ScriptManager.cs
- UnknownWrapper.cs
- DispatcherEventArgs.cs
- IdnMapping.cs
- ProtocolException.cs
- ReaderOutput.cs
- RoutedEvent.cs