Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / ThemeableAttribute.cs / 1 / ThemeableAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Web.UI { using System; using System.Collections; using System.ComponentModel; using System.Security.Permissions; ////// [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class)] public sealed class ThemeableAttribute : Attribute { ////// /// /// public static readonly ThemeableAttribute Yes = new ThemeableAttribute(true); ////// /// /// public static readonly ThemeableAttribute No = new ThemeableAttribute(false); ////// /// /// public static readonly ThemeableAttribute Default = Yes; private bool _themeable = false; private static Hashtable _themeableTypes; static ThemeableAttribute() { // Create a synchronized wrapper _themeableTypes = Hashtable.Synchronized(new Hashtable()); } ////// /// public ThemeableAttribute(bool themeable) { _themeable = themeable; } ////// public bool Themeable { get { return _themeable; } } ///Indicates if the property is themeable. ///public override bool Equals(object obj) { if (obj == this) { return true; } ThemeableAttribute other = obj as ThemeableAttribute; return (other != null) && (other.Themeable == _themeable); } /// public override int GetHashCode() { return _themeable.GetHashCode(); } /// public override bool IsDefaultAttribute() { return this.Equals(Default); } public static bool IsObjectThemeable(Object instance) { if (instance == null) throw new ArgumentNullException("instance"); return IsTypeThemeable(instance.GetType()); } public static bool IsTypeThemeable(Type type) { if (type == null) throw new ArgumentNullException("type"); object result = _themeableTypes[type]; if (result != null) { return (bool)result; } System.ComponentModel.AttributeCollection attrs = TypeDescriptor.GetAttributes(type); ThemeableAttribute attr = (ThemeableAttribute)attrs[typeof(ThemeableAttribute)]; result = (attr != null) && attr.Themeable; _themeableTypes[type] = result; return (bool)result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Web.UI { using System; using System.Collections; using System.ComponentModel; using System.Security.Permissions; ////// [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class)] public sealed class ThemeableAttribute : Attribute { ////// /// /// public static readonly ThemeableAttribute Yes = new ThemeableAttribute(true); ////// /// /// public static readonly ThemeableAttribute No = new ThemeableAttribute(false); ////// /// /// public static readonly ThemeableAttribute Default = Yes; private bool _themeable = false; private static Hashtable _themeableTypes; static ThemeableAttribute() { // Create a synchronized wrapper _themeableTypes = Hashtable.Synchronized(new Hashtable()); } ////// /// public ThemeableAttribute(bool themeable) { _themeable = themeable; } ////// public bool Themeable { get { return _themeable; } } ///Indicates if the property is themeable. ///public override bool Equals(object obj) { if (obj == this) { return true; } ThemeableAttribute other = obj as ThemeableAttribute; return (other != null) && (other.Themeable == _themeable); } /// public override int GetHashCode() { return _themeable.GetHashCode(); } /// public override bool IsDefaultAttribute() { return this.Equals(Default); } public static bool IsObjectThemeable(Object instance) { if (instance == null) throw new ArgumentNullException("instance"); return IsTypeThemeable(instance.GetType()); } public static bool IsTypeThemeable(Type type) { if (type == null) throw new ArgumentNullException("type"); object result = _themeableTypes[type]; if (result != null) { return (bool)result; } System.ComponentModel.AttributeCollection attrs = TypeDescriptor.GetAttributes(type); ThemeableAttribute attr = (ThemeableAttribute)attrs[typeof(ThemeableAttribute)]; result = (attr != null) && attr.Themeable; _themeableTypes[type] = result; return (bool)result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewCellValueEventArgs.cs
- Timer.cs
- IPAddressCollection.cs
- WebPartHeaderCloseVerb.cs
- Pkcs9Attribute.cs
- DynamicActionMessageFilter.cs
- Assert.cs
- XPathExpr.cs
- EmptyControlCollection.cs
- HiddenField.cs
- TableMethodGenerator.cs
- WindowPattern.cs
- DataGridViewCellValidatingEventArgs.cs
- ExpandCollapsePattern.cs
- GroupQuery.cs
- UpdateExpressionVisitor.cs
- SHA256Cng.cs
- DiscreteKeyFrames.cs
- DataTemplate.cs
- SoapExtension.cs
- TreeViewEvent.cs
- SafeNativeMethods.cs
- HttpInputStream.cs
- OleDbPropertySetGuid.cs
- CodeGotoStatement.cs
- SqlExpressionNullability.cs
- XPathExpr.cs
- NativeActivityContext.cs
- ObjectSecurity.cs
- Size3DConverter.cs
- CollectionChangeEventArgs.cs
- SmtpLoginAuthenticationModule.cs
- TransformerConfigurationWizardBase.cs
- DataGridPageChangedEventArgs.cs
- XmlMemberMapping.cs
- DynamicRendererThreadManager.cs
- Transform3DGroup.cs
- UInt64Converter.cs
- UrlAuthFailedErrorFormatter.cs
- sqlinternaltransaction.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- TextParentUndoUnit.cs
- RegisteredDisposeScript.cs
- XNodeSchemaApplier.cs
- translator.cs
- AsymmetricKeyExchangeFormatter.cs
- QueueException.cs
- OleDbSchemaGuid.cs
- ChannelDemuxer.cs
- ColorAnimation.cs
- Emitter.cs
- StickyNoteContentControl.cs
- PersonalizationState.cs
- DivideByZeroException.cs
- ObjectStorage.cs
- LifetimeServices.cs
- OpacityConverter.cs
- PeerResolver.cs
- BinaryFormatter.cs
- Int16.cs
- XDeferredAxisSource.cs
- ArrayWithOffset.cs
- DocumentGridPage.cs
- Border.cs
- DataGridViewCellEventArgs.cs
- FixedFindEngine.cs
- ConfigXmlComment.cs
- ResourceAssociationSetEnd.cs
- SystemFonts.cs
- ConfigurationValidatorBase.cs
- Misc.cs
- TimeStampChecker.cs
- NamespaceCollection.cs
- EntityDataSourceStatementEditorForm.cs
- WinOEToolBoxItem.cs
- SchemaTypeEmitter.cs
- ImportedPolicyConversionContext.cs
- UIElementCollection.cs
- mediaclock.cs
- InternalPermissions.cs
- DataControlFieldHeaderCell.cs
- TextFormatterContext.cs
- BamlLocalizabilityResolver.cs
- WindowsFormsDesignerOptionService.cs
- StreamResourceInfo.cs
- OdbcErrorCollection.cs
- DiagnosticsConfigurationHandler.cs
- CollectionChangeEventArgs.cs
- ArcSegment.cs
- HyperLinkDesigner.cs
- TextServicesLoader.cs
- StructuredTypeEmitter.cs
- EndpointInfoCollection.cs
- CommonXSendMessage.cs
- ByteStreamGeometryContext.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- BridgeDataReader.cs
- CompatibleIComparer.cs
- BackgroundFormatInfo.cs
- GeneralTransform3DTo2DTo3D.cs