Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / SystemThemeKey.cs / 1305600 / SystemThemeKey.cs
//---------------------------------------------------------------------------- // // Copyright (C) 2004 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Reflection; using System.Text; using System.Windows; using System.Windows.Markup; using System.ComponentModel; using System.Diagnostics; namespace System.Windows { ////// Implements ResourceKey to create unique keys for our system resources. /// Keys will be exposed publicly only with the ResourceKey API. /// [TypeConverter(typeof(System.Windows.Markup.SystemKeyConverter))] internal class SystemThemeKey : ResourceKey { ////// Constructs a new instance of the key with the given ID. /// /// The internal, unique ID of the system resource. internal SystemThemeKey(SystemResourceKeyID id) { _id = id; Debug.Assert(id > SystemResourceKeyID.InternalSystemThemeStylesStart && id < SystemResourceKeyID.InternalSystemThemeStylesEnd); } ////// Used to determine where to look for the resource dictionary that holds this resource. /// public override Assembly Assembly { get { if (_presentationFrameworkAssembly == null) { _presentationFrameworkAssembly = typeof(FrameworkElement).Assembly; } return _presentationFrameworkAssembly; } } ////// Determines if the passed in object is equal to this object. /// Two keys will be equal if they both have the same ID. /// /// The object to compare with. ///True if the objects are equal. False otherwise. public override bool Equals(object o) { SystemThemeKey key = o as SystemThemeKey; if (key != null) { return key._id == this._id; } return false; } ////// Serves as a hash function for a particular type. /// public override int GetHashCode() { return (int)_id; } ////// get string representation of this key /// ///the string representation of the key public override string ToString() { return _id.ToString(); } internal SystemResourceKeyID InternalKey { get { return _id; } } private SystemResourceKeyID _id; private static Assembly _presentationFrameworkAssembly; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) 2004 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Reflection; using System.Text; using System.Windows; using System.Windows.Markup; using System.ComponentModel; using System.Diagnostics; namespace System.Windows { ////// Implements ResourceKey to create unique keys for our system resources. /// Keys will be exposed publicly only with the ResourceKey API. /// [TypeConverter(typeof(System.Windows.Markup.SystemKeyConverter))] internal class SystemThemeKey : ResourceKey { ////// Constructs a new instance of the key with the given ID. /// /// The internal, unique ID of the system resource. internal SystemThemeKey(SystemResourceKeyID id) { _id = id; Debug.Assert(id > SystemResourceKeyID.InternalSystemThemeStylesStart && id < SystemResourceKeyID.InternalSystemThemeStylesEnd); } ////// Used to determine where to look for the resource dictionary that holds this resource. /// public override Assembly Assembly { get { if (_presentationFrameworkAssembly == null) { _presentationFrameworkAssembly = typeof(FrameworkElement).Assembly; } return _presentationFrameworkAssembly; } } ////// Determines if the passed in object is equal to this object. /// Two keys will be equal if they both have the same ID. /// /// The object to compare with. ///True if the objects are equal. False otherwise. public override bool Equals(object o) { SystemThemeKey key = o as SystemThemeKey; if (key != null) { return key._id == this._id; } return false; } ////// Serves as a hash function for a particular type. /// public override int GetHashCode() { return (int)_id; } ////// get string representation of this key /// ///the string representation of the key public override string ToString() { return _id.ToString(); } internal SystemResourceKeyID InternalKey { get { return _id; } } private SystemResourceKeyID _id; private static Assembly _presentationFrameworkAssembly; } } // 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
- DependencyPropertyDescriptor.cs
- SuppressMessageAttribute.cs
- ExecutionContext.cs
- Point3DCollectionValueSerializer.cs
- Cursors.cs
- InvokePattern.cs
- XmlSchemaAttribute.cs
- ReflectionUtil.cs
- ConfigurationFileMap.cs
- CompositeScriptReference.cs
- TransactionBehavior.cs
- FtpWebResponse.cs
- AutoResetEvent.cs
- BitFlagsGenerator.cs
- UserInitiatedNavigationPermission.cs
- StorageBasedPackageProperties.cs
- TCPListener.cs
- CommandConverter.cs
- XmlSchemaExternal.cs
- ClientSideProviderDescription.cs
- MultiView.cs
- Grant.cs
- DrawingContextDrawingContextWalker.cs
- StorageAssociationSetMapping.cs
- ApplicationContext.cs
- _NegotiateClient.cs
- PageThemeCodeDomTreeGenerator.cs
- PictureBox.cs
- ToolStrip.cs
- Bits.cs
- DbConnectionStringBuilder.cs
- ToolboxBitmapAttribute.cs
- SplineQuaternionKeyFrame.cs
- IssuedSecurityTokenProvider.cs
- ConnectionPool.cs
- AnnotationComponentManager.cs
- UserControlDocumentDesigner.cs
- HttpServerChannel.cs
- HostExecutionContextManager.cs
- ErrorWrapper.cs
- FixedTextPointer.cs
- BufferAllocator.cs
- UnorderedHashRepartitionStream.cs
- ImageSource.cs
- SingleStorage.cs
- HwndProxyElementProvider.cs
- BrowserDefinition.cs
- GeneralTransform3DGroup.cs
- ViewManager.cs
- ProtectedProviderSettings.cs
- ClientConfigurationHost.cs
- ElementUtil.cs
- CapabilitiesSection.cs
- XmlUrlResolver.cs
- SqlFunctionAttribute.cs
- StoreItemCollection.cs
- HighContrastHelper.cs
- RegistryPermission.cs
- NullReferenceException.cs
- TextPointerBase.cs
- XmlSchemaAttributeGroupRef.cs
- DecryptRequest.cs
- TextTreePropertyUndoUnit.cs
- odbcmetadatacollectionnames.cs
- ScrollBarAutomationPeer.cs
- HttpServerUtilityBase.cs
- SchemaImporterExtensionElement.cs
- PersonalizationStateInfo.cs
- InternalSendMessage.cs
- LicFileLicenseProvider.cs
- CollectionViewSource.cs
- SliderAutomationPeer.cs
- FormViewModeEventArgs.cs
- ByteStreamMessageEncodingElement.cs
- FrameworkRichTextComposition.cs
- CounterSampleCalculator.cs
- CommonRemoteMemoryBlock.cs
- PrintingPermissionAttribute.cs
- MemberHolder.cs
- SmtpNetworkElement.cs
- CurrentTimeZone.cs
- PathSegment.cs
- DataGridViewSelectedColumnCollection.cs
- X509InitiatorCertificateServiceElement.cs
- precedingsibling.cs
- XmlQueryContext.cs
- SqlDelegatedTransaction.cs
- FeatureAttribute.cs
- CircleHotSpot.cs
- XmlDocument.cs
- MachineKeySection.cs
- MediaPlayer.cs
- CollectionContainer.cs
- DefaultPerformanceCounters.cs
- InvocationExpression.cs
- AnnotationService.cs
- AttachedAnnotationChangedEventArgs.cs
- RootProfilePropertySettingsCollection.cs
- FormDesigner.cs
- RSAOAEPKeyExchangeDeformatter.cs