Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / Localizer / BamlLocalizableResourceKey.cs / 1305600 / BamlLocalizableResourceKey.cs
//---------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // Description: BamlLocalizableResourceKey class // // History: // 03/25/2005 garyyang - 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. // // Description: BamlLocalizableResourceKey class // // History: // 03/25/2005 garyyang - 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OleDbError.cs
- SerializationHelper.cs
- TemplateContentLoader.cs
- MenuAutoFormat.cs
- Constant.cs
- RequestStatusBarUpdateEventArgs.cs
- ObjectStateEntryDbDataRecord.cs
- TcpProcessProtocolHandler.cs
- ConsumerConnectionPoint.cs
- ContainerUtilities.cs
- ClosableStream.cs
- OleDbEnumerator.cs
- HandlerBase.cs
- CryptoApi.cs
- GuidelineCollection.cs
- BitmapImage.cs
- Facet.cs
- ImportCatalogPart.cs
- HwndMouseInputProvider.cs
- FileSecurity.cs
- CompilerTypeWithParams.cs
- SafeSystemMetrics.cs
- WindowsEditBox.cs
- StrokeFIndices.cs
- RotateTransform.cs
- CursorConverter.cs
- FormsAuthenticationEventArgs.cs
- TraversalRequest.cs
- ConstraintCollection.cs
- XmlNamespaceMapping.cs
- HttpStaticObjectsCollectionBase.cs
- DataGridHeaderBorder.cs
- DrawingCollection.cs
- LinqDataSourceDisposeEventArgs.cs
- TemplateControlBuildProvider.cs
- CreateUserWizardDesigner.cs
- DeploymentSection.cs
- MethodBuilderInstantiation.cs
- AttributeCollection.cs
- EnumerableCollectionView.cs
- Activity.cs
- HttpModule.cs
- SafeNativeMethods.cs
- BitmapPalettes.cs
- WindowHideOrCloseTracker.cs
- AsymmetricSignatureDeformatter.cs
- TreePrinter.cs
- ErrorWebPart.cs
- UntrustedRecipientException.cs
- BinaryWriter.cs
- UriTemplateHelpers.cs
- DataGridHeaderBorder.cs
- DataPagerField.cs
- PictureBox.cs
- SelectManyQueryOperator.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- RTLAwareMessageBox.cs
- TextSelectionProcessor.cs
- ExternalException.cs
- DetailsViewUpdatedEventArgs.cs
- BinaryObjectReader.cs
- _NegoStream.cs
- DataListItem.cs
- ExecutedRoutedEventArgs.cs
- StreamHelper.cs
- HMACSHA256.cs
- ToolStripItemImageRenderEventArgs.cs
- StructuredType.cs
- SqlMethodAttribute.cs
- SettingsProviderCollection.cs
- EditingCommands.cs
- DesignerOptions.cs
- ViewEventArgs.cs
- ProcessHost.cs
- ScriptControl.cs
- ColorMatrix.cs
- QuestionEventArgs.cs
- CachedCompositeFamily.cs
- ViewEventArgs.cs
- _UriSyntax.cs
- DefaultMemberAttribute.cs
- WebSysDisplayNameAttribute.cs
- ClientScriptManagerWrapper.cs
- NotifyCollectionChangedEventArgs.cs
- InkPresenter.cs
- HMACSHA256.cs
- TreePrinter.cs
- StateMachineWorkflowInstance.cs
- EventWaitHandleSecurity.cs
- HtmlValidationSummaryAdapter.cs
- RuleRef.cs
- ServiceObjectContainer.cs
- XmlAttributeAttribute.cs
- control.ime.cs
- EntityTypeEmitter.cs
- TextWriter.cs
- EventLogTraceListener.cs
- WinFormsComponentEditor.cs
- WebPartHeaderCloseVerb.cs
- ScrollChangedEventArgs.cs