Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Markup / Localizer / BamlLocalizableResourceKey.cs / 1 / BamlLocalizableResourceKey.cs
//---------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // Description: BamlLocalizableResourceKey class // // History: // 03/25/2005 [....] - created the file // //--------------------------------------------------------------------------- using System; namespace System.Windows.Markup.Localizer { ////// Key to BamlLocalizableResource /// public class BamlLocalizableResourceKey { //------------------------------- // Constructor //------------------------------- internal BamlLocalizableResourceKey( string uid, string className, string propertyName, string assemblyName ) { if (uid == null) { throw new ArgumentNullException("uid"); } if (className == null) { throw new ArgumentNullException("className"); } if (propertyName == null) { throw new ArgumentNullException("propertyName"); } _uid = uid; _className = className; _propertyName = propertyName; _assemblyName = assemblyName; } ////// Construct a key to the BamlLocalizableResource. The key /// consists of name, class name and property name, which will be used to /// identify a localizable resource in Baml. /// /// The unique id of the element that has the localizable resource. It is equivalent of x:Uid in XAML file. /// class name of localizable resource in Baml. /// property name of the localizable resource in Baml public BamlLocalizableResourceKey( string uid, string className, string propertyName ) : this (uid, className, propertyName, null) { } //------------------------------- // Public properties //------------------------------- ////// Id of the element that has the localizable resource /// public string Uid { get { return _uid; } } ////// Class name of the localizable resource /// public string ClassName { get { return _className; } } ////// Property name of the localizable resource /// public string PropertyName { get { return _propertyName; } } ////// The name of the assembly that defines the type of the localizable resource. /// ////// Assembly name is not required for uniquely identifying a resource in Baml. It is /// popluated when extracting resources from Baml so that users can find the type information /// of the localizable resource. /// public string AssemblyName { get { return _assemblyName; } } ////// Compare two BamlLocalizableResourceKey objects /// /// The other BamlLocalizableResourceKey object to be compared against ///True if they are equal. False otherwise public bool Equals(BamlLocalizableResourceKey other) { if (other == null) { return false; } return _uid == other._uid && _className == other._className && _propertyName == other._propertyName; } ////// Compare two BamlLocalizableResourceKey objects /// /// The other BamlLocalizableResourceKey object to be compared against ///True if they are equal. False otherwise public override bool Equals(object other) { return Equals(other as BamlLocalizableResourceKey); } ////// Get the hashcode of this object /// ///Hash code public override int GetHashCode() { return _uid.GetHashCode() ^ _className.GetHashCode() ^ _propertyName.GetHashCode(); } //------------------------------- // Private members //------------------------------- private string _uid; private string _className; private string _propertyName; private string _assemblyName; } } // 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
- ElementUtil.cs
- ImageBrush.cs
- XPathBinder.cs
- DbgCompiler.cs
- BmpBitmapDecoder.cs
- EntityViewContainer.cs
- QuaternionConverter.cs
- InheritanceRules.cs
- basecomparevalidator.cs
- ResourceFallbackManager.cs
- UmAlQuraCalendar.cs
- AutomationProperties.cs
- FullTrustAssembly.cs
- PartialCachingControl.cs
- XmlBinaryWriter.cs
- DetailsViewDeleteEventArgs.cs
- SimpleTypeResolver.cs
- Behavior.cs
- SizeFConverter.cs
- GlobalAllocSafeHandle.cs
- FilterQueryOptionExpression.cs
- ListSourceHelper.cs
- OdbcConnectionOpen.cs
- SHA256Managed.cs
- TrustLevelCollection.cs
- CodeExpressionCollection.cs
- __Filters.cs
- ReflectTypeDescriptionProvider.cs
- DriveNotFoundException.cs
- base64Transforms.cs
- GridErrorDlg.cs
- BitmapEffectDrawingContextState.cs
- SelectionRange.cs
- DiscoveryReference.cs
- HMACSHA384.cs
- Window.cs
- StringBuilder.cs
- ClientScriptManager.cs
- DoubleIndependentAnimationStorage.cs
- TreeNodeStyle.cs
- DragStartedEventArgs.cs
- indexingfiltermarshaler.cs
- HierarchicalDataBoundControlAdapter.cs
- StrongNameUtility.cs
- ProfilePropertyMetadata.cs
- ConnectionStringsSection.cs
- PropertyConverter.cs
- ActivationServices.cs
- GridLengthConverter.cs
- VectorCollection.cs
- ConstrainedDataObject.cs
- RotateTransform.cs
- ReaderWriterLock.cs
- XsltOutput.cs
- Int32AnimationBase.cs
- SectionRecord.cs
- LookupBindingPropertiesAttribute.cs
- Helpers.cs
- CreateUserWizardStep.cs
- FtpCachePolicyElement.cs
- EncoderReplacementFallback.cs
- OdbcHandle.cs
- FormClosingEvent.cs
- TransformerConfigurationWizardBase.cs
- ExpressionParser.cs
- RightsManagementEncryptedStream.cs
- TemplateXamlTreeBuilder.cs
- TlsSspiNegotiation.cs
- Vector.cs
- BrowserCapabilitiesFactoryBase.cs
- TextTreeInsertElementUndoUnit.cs
- FacetDescription.cs
- HttpResponse.cs
- COM2ColorConverter.cs
- ExpanderAutomationPeer.cs
- CacheSection.cs
- StoreContentChangedEventArgs.cs
- LinqDataSourceUpdateEventArgs.cs
- Timeline.cs
- EntitySqlException.cs
- RuleSettings.cs
- Graph.cs
- SQLSingle.cs
- AnnouncementDispatcherAsyncResult.cs
- sqlnorm.cs
- UpDownEvent.cs
- ConstraintConverter.cs
- basecomparevalidator.cs
- PreviewPrintController.cs
- HttpApplicationStateWrapper.cs
- SudsWriter.cs
- XmlNotation.cs
- SqlBulkCopyColumnMapping.cs
- ResourcePool.cs
- RelatedPropertyManager.cs
- Command.cs
- UITypeEditor.cs
- CodeSnippetExpression.cs
- XPathNodeInfoAtom.cs
- SettingsPropertyIsReadOnlyException.cs