Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / ThemeableAttribute.cs / 1305376 / ThemeableAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Web.UI { using System; using System.Collections; using System.ComponentModel; ////// [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)]; ThemeableAttribute attr = Attribute.GetCustomAttribute(type, typeof(ThemeableAttribute)) as ThemeableAttribute; result = (attr != null) && attr.Themeable; _themeableTypes[type] = result; return (bool)result; } } } // 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
- ListViewItemMouseHoverEvent.cs
- SafeBitVector32.cs
- EndpointDesigner.cs
- BindingGroup.cs
- SafeEventLogWriteHandle.cs
- WebConfigurationManager.cs
- ContractType.cs
- CompoundFileStorageReference.cs
- DbConnectionClosed.cs
- XmlNavigatorStack.cs
- EventSetter.cs
- ToolStripSeparatorRenderEventArgs.cs
- SqlGatherProducedAliases.cs
- TableRowGroup.cs
- RtfToXamlReader.cs
- RawUIStateInputReport.cs
- InheritablePropertyChangeInfo.cs
- NumberFunctions.cs
- Convert.cs
- CssClassPropertyAttribute.cs
- BamlLocalizationDictionary.cs
- XPathMultyIterator.cs
- Material.cs
- BStrWrapper.cs
- SRDisplayNameAttribute.cs
- CheckoutException.cs
- Variable.cs
- TextContainerHelper.cs
- SizeChangedInfo.cs
- ResolveMatchesMessageCD1.cs
- HttpResponseHeader.cs
- DiscardableAttribute.cs
- GeometryHitTestResult.cs
- XmlQueryTypeFactory.cs
- ProviderSettings.cs
- ServerValidateEventArgs.cs
- TheQuery.cs
- securitycriticaldataClass.cs
- XsltLibrary.cs
- TableColumnCollection.cs
- PointAnimationUsingKeyFrames.cs
- UnionCqlBlock.cs
- SmiEventStream.cs
- WebPart.cs
- ApplicationDirectoryMembershipCondition.cs
- Ipv6Element.cs
- XamlToRtfWriter.cs
- DataSourceDescriptorCollection.cs
- ScaleTransform3D.cs
- DependencyObjectType.cs
- PostBackTrigger.cs
- StringToken.cs
- XmlArrayItemAttributes.cs
- FtpWebResponse.cs
- QueryReaderSettings.cs
- WebControl.cs
- DataServiceQueryException.cs
- TreeViewEvent.cs
- ChangeInterceptorAttribute.cs
- ValidationSummary.cs
- DataPagerFieldItem.cs
- COM2TypeInfoProcessor.cs
- CharKeyFrameCollection.cs
- Path.cs
- ObjectQuery_EntitySqlExtensions.cs
- XslTransform.cs
- DocumentCollection.cs
- ResourceReferenceExpression.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- figurelength.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ContextBase.cs
- PageTheme.cs
- AmbientProperties.cs
- ManagedWndProcTracker.cs
- SystemIPGlobalStatistics.cs
- SqlRecordBuffer.cs
- XmlSchemaObjectCollection.cs
- RenderTargetBitmap.cs
- UnmanagedHandle.cs
- StorageFunctionMapping.cs
- PageSettings.cs
- SecurityUtils.cs
- ListViewSelectEventArgs.cs
- serverconfig.cs
- EntityConnectionStringBuilder.cs
- GridLength.cs
- ProfileProvider.cs
- GridViewCommandEventArgs.cs
- HttpWriter.cs
- DataGridViewCellLinkedList.cs
- DependencySource.cs
- ResourceReferenceExpressionConverter.cs
- ContentType.cs
- DataTransferEventArgs.cs
- StickyNoteContentControl.cs
- CommandPlan.cs
- ArrayList.cs
- MarkupCompiler.cs
- SrgsSubset.cs