Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / Markup / Localizer / BamlLocalizableResourceKey.cs / 1 / 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
- HttpDateParse.cs
- InstanceContextManager.cs
- DomNameTable.cs
- LiteralControl.cs
- ProfilePropertyMetadata.cs
- COMException.cs
- UpdateCommandGenerator.cs
- MatrixKeyFrameCollection.cs
- Int16Animation.cs
- ToggleProviderWrapper.cs
- SelectionUIService.cs
- SemaphoreFullException.cs
- IIS7UserPrincipal.cs
- assertwrapper.cs
- FlowDocumentFormatter.cs
- ArgumentException.cs
- DefaultMergeHelper.cs
- SendingRequestEventArgs.cs
- NetTcpSecurity.cs
- NativeDirectoryServicesQueryAPIs.cs
- RegexWorker.cs
- Error.cs
- FileSystemInfo.cs
- TriggerAction.cs
- ComboBox.cs
- BamlRecordWriter.cs
- MemberPath.cs
- entityreference_tresulttype.cs
- HeaderedContentControl.cs
- XmlObjectSerializerReadContext.cs
- RoutingSection.cs
- Graphics.cs
- ObjectView.cs
- CapabilitiesPattern.cs
- PropertyOverridesDialog.cs
- DescendantOverDescendantQuery.cs
- HtmlElementErrorEventArgs.cs
- PenThread.cs
- XmlSchemaSequence.cs
- safemediahandle.cs
- NaturalLanguageHyphenator.cs
- WebPartCollection.cs
- PopupRootAutomationPeer.cs
- TextSpanModifier.cs
- DynamicEndpointElement.cs
- WebResourceAttribute.cs
- Compiler.cs
- SkewTransform.cs
- PropertySet.cs
- DupHandleConnectionReader.cs
- IEnumerable.cs
- Comparer.cs
- DockAndAnchorLayout.cs
- StorageComplexPropertyMapping.cs
- CommandBinding.cs
- ZipFileInfo.cs
- HandlerBase.cs
- TargetParameterCountException.cs
- UnsafeNativeMethods.cs
- _HeaderInfoTable.cs
- MenuBindingsEditorForm.cs
- AppDomainUnloadedException.cs
- CapabilitiesState.cs
- OutputCacheSettingsSection.cs
- ToolStripPanelCell.cs
- QueryCacheEntry.cs
- UserPreferenceChangedEventArgs.cs
- InputElement.cs
- VersionConverter.cs
- BitmapEffectDrawingContextState.cs
- CompilerErrorCollection.cs
- SchemaComplexType.cs
- securitycriticaldataClass.cs
- TCEAdapterGenerator.cs
- WebSysDefaultValueAttribute.cs
- BufferedGraphicsContext.cs
- PenLineJoinValidation.cs
- ExpressionNormalizer.cs
- GlyphInfoList.cs
- TextServicesProperty.cs
- DataSourceControl.cs
- EraserBehavior.cs
- MenuBindingsEditorForm.cs
- ObjectReaderCompiler.cs
- PerfCounters.cs
- KeyGestureConverter.cs
- TableLayoutPanel.cs
- SmtpReplyReaderFactory.cs
- RemotingException.cs
- UnsafeNativeMethods.cs
- ApplicationGesture.cs
- MembershipValidatePasswordEventArgs.cs
- FileReservationCollection.cs
- GradientStopCollection.cs
- MemberHolder.cs
- SessionState.cs
- EventRecordWrittenEventArgs.cs
- WebPartZoneBase.cs
- MSHTMLHost.cs
- COM2PropertyBuilderUITypeEditor.cs