Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebPartExportVerb.cs
- PeerOutputChannel.cs
- PersonalizationAdministration.cs
- PrtCap_Public_Simple.cs
- OrderPreservingPipeliningSpoolingTask.cs
- XmlSchemaComplexContent.cs
- AnnotationResourceCollection.cs
- xmlfixedPageInfo.cs
- SecurityUniqueId.cs
- DateTimeFormatInfoScanner.cs
- TextEditorSpelling.cs
- MailWriter.cs
- SHA384Managed.cs
- XmlSchemaSubstitutionGroup.cs
- ReaderContextStackData.cs
- DataGridCellsPresenter.cs
- CompatibleComparer.cs
- PropertyPath.cs
- ValidatorUtils.cs
- wmiprovider.cs
- StringReader.cs
- WebProxyScriptElement.cs
- SerializerWriterEventHandlers.cs
- GenericNameHandler.cs
- EventHandlerService.cs
- CodeMethodInvokeExpression.cs
- OrthographicCamera.cs
- CustomCategoryAttribute.cs
- BuiltInExpr.cs
- ContainerParaClient.cs
- XmlKeywords.cs
- HttpRuntime.cs
- ProcessThreadCollection.cs
- DataGridViewComboBoxCell.cs
- CompiledRegexRunner.cs
- TextShapeableCharacters.cs
- BaseProcessor.cs
- PagerSettings.cs
- ViewCellSlot.cs
- ItemsControlAutomationPeer.cs
- AmbientLight.cs
- HtmlHead.cs
- ConstNode.cs
- CodeCatchClause.cs
- PrinterSettings.cs
- DataBindingCollectionConverter.cs
- StaticFileHandler.cs
- CustomTypeDescriptor.cs
- XsdValidatingReader.cs
- MetadataItemEmitter.cs
- PropertyTabChangedEvent.cs
- ClientBuildManager.cs
- TransportSecurityProtocol.cs
- JsonGlobals.cs
- UshortList2.cs
- LogEntryHeaderDeserializer.cs
- SyndicationDeserializer.cs
- ModelItemCollection.cs
- ForeignKeyConstraint.cs
- WebConfigurationManager.cs
- XmlParser.cs
- NameSpaceEvent.cs
- MD5CryptoServiceProvider.cs
- EditorResources.cs
- TimeIntervalCollection.cs
- UIElement3D.cs
- SendMailErrorEventArgs.cs
- Identity.cs
- InitialServerConnectionReader.cs
- Bits.cs
- EnumBuilder.cs
- TimeoutException.cs
- WebBaseEventKeyComparer.cs
- GenericArgumentsUpdater.cs
- HtmlTable.cs
- XmlWellformedWriter.cs
- PersonalizationProviderCollection.cs
- DataGrid.cs
- MsmqTransportBindingElement.cs
- ListItem.cs
- ImagingCache.cs
- FormDesigner.cs
- PathFigure.cs
- ValidateNames.cs
- ScrollItemPattern.cs
- RightsManagementEncryptedStream.cs
- SoundPlayer.cs
- Viewport3DAutomationPeer.cs
- SafeNativeMethods.cs
- GridItemPatternIdentifiers.cs
- ClientTarget.cs
- fixedPageContentExtractor.cs
- ToolStripItem.cs
- ComponentCollection.cs
- XmlBinaryWriter.cs
- PackageDigitalSignatureManager.cs
- IdentityHolder.cs
- GridViewRowPresenter.cs
- GridItem.cs
- ResourceSet.cs