Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / System / Windows / LocalizabilityAttribute.cs / 1 / LocalizabilityAttribute.cs
//------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2001 // // File: LocalizabiltyAttribute.cs // // Contents: Localizability attributes // // Created: 3/17/2004 Garyyang // 7/19/2004 garyyang, Update according to new spec. // // //----------------------------------------------------------------------- using System; using System.ComponentModel; namespace System.Windows { ////// Specifies the localization preferences for a class or property in Baml /// The attribute can be specified on Class, Property and Method /// [AttributeUsage( AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Struct, AllowMultiple = false, Inherited = true) ] public sealed class LocalizabilityAttribute : Attribute { ////// Construct a LocalizabilityAttribute to describe the localizability of a property. /// Modifiability property default to Modifiability.Modifiable, and Readability property /// default to Readability.Readable. /// /// the string category given to the item public LocalizabilityAttribute(LocalizationCategory category) { if ( category < LocalizationCategory.None || category > LocalizationCategory.NeverLocalize) { throw new InvalidEnumArgumentException( "category", (int)category, typeof(LocalizationCategory) ); } _category = category; _readability = Readability.Readable; _modifiability = Modifiability.Modifiable; } ////// String category /// ///gets or sets the string category for the item public LocalizationCategory Category { // should have only getter, because it is a required parameter to the constructor get { return _category; } } ////// Get or set the readability of the attribute's targeted value /// ///Readability public Readability Readability { get { return _readability; } set { if ( value != Readability.Unreadable && value != Readability.Readable && value != Readability.Inherit) { throw new InvalidEnumArgumentException("Readability", (int) value, typeof(Readability)); } _readability = value; } } ////// Get or set the modifiability of the attribute's targeted value /// ///Modifiability public Modifiability Modifiability { get { return _modifiability; } set { if ( value != Modifiability.Unmodifiable && value != Modifiability.Modifiable && value != Modifiability.Inherit) { throw new InvalidEnumArgumentException("Modifiability", (int) value, typeof(Modifiability)); } _modifiability = value; } } //-------------------------------------------- // Private members //-------------------------------------------- private LocalizationCategory _category; private Readability _readability; private Modifiability _modifiability; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2001 // // File: LocalizabiltyAttribute.cs // // Contents: Localizability attributes // // Created: 3/17/2004 Garyyang // 7/19/2004 garyyang, Update according to new spec. // // //----------------------------------------------------------------------- using System; using System.ComponentModel; namespace System.Windows { ////// Specifies the localization preferences for a class or property in Baml /// The attribute can be specified on Class, Property and Method /// [AttributeUsage( AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Struct, AllowMultiple = false, Inherited = true) ] public sealed class LocalizabilityAttribute : Attribute { ////// Construct a LocalizabilityAttribute to describe the localizability of a property. /// Modifiability property default to Modifiability.Modifiable, and Readability property /// default to Readability.Readable. /// /// the string category given to the item public LocalizabilityAttribute(LocalizationCategory category) { if ( category < LocalizationCategory.None || category > LocalizationCategory.NeverLocalize) { throw new InvalidEnumArgumentException( "category", (int)category, typeof(LocalizationCategory) ); } _category = category; _readability = Readability.Readable; _modifiability = Modifiability.Modifiable; } ////// String category /// ///gets or sets the string category for the item public LocalizationCategory Category { // should have only getter, because it is a required parameter to the constructor get { return _category; } } ////// Get or set the readability of the attribute's targeted value /// ///Readability public Readability Readability { get { return _readability; } set { if ( value != Readability.Unreadable && value != Readability.Readable && value != Readability.Inherit) { throw new InvalidEnumArgumentException("Readability", (int) value, typeof(Readability)); } _readability = value; } } ////// Get or set the modifiability of the attribute's targeted value /// ///Modifiability public Modifiability Modifiability { get { return _modifiability; } set { if ( value != Modifiability.Unmodifiable && value != Modifiability.Modifiable && value != Modifiability.Inherit) { throw new InvalidEnumArgumentException("Modifiability", (int) value, typeof(Modifiability)); } _modifiability = value; } } //-------------------------------------------- // Private members //-------------------------------------------- private LocalizationCategory _category; private Readability _readability; private Modifiability _modifiability; } } // 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
- hresults.cs
- SqlXml.cs
- TextParaLineResult.cs
- LinqDataSourceDeleteEventArgs.cs
- AccessDataSourceView.cs
- CompiledXpathExpr.cs
- SimpleHandlerFactory.cs
- SimpleWorkerRequest.cs
- MimePart.cs
- SystemIPGlobalProperties.cs
- UnknownWrapper.cs
- TextParagraphView.cs
- Token.cs
- BaseUriHelper.cs
- SmiEventSink_Default.cs
- DataServiceCollectionOfT.cs
- DefaultMemberAttribute.cs
- SoapElementAttribute.cs
- IISUnsafeMethods.cs
- MaterialGroup.cs
- TextSelection.cs
- StreamSecurityUpgradeProvider.cs
- ProgressBarHighlightConverter.cs
- InstanceLockQueryResult.cs
- SelectionListComponentEditor.cs
- MethodToken.cs
- StreamWriter.cs
- SmtpDateTime.cs
- PropertyItemInternal.cs
- InfocardExtendedInformationEntry.cs
- IndicCharClassifier.cs
- Single.cs
- ProtocolsSection.cs
- IIS7UserPrincipal.cs
- Vector3DCollection.cs
- DBConnectionString.cs
- TemplatedControlDesigner.cs
- MethodBuilderInstantiation.cs
- QilExpression.cs
- Point3DAnimation.cs
- XamlFrame.cs
- Vector3DCollectionConverter.cs
- DescendentsWalkerBase.cs
- CollectionViewGroupRoot.cs
- PolicyStatement.cs
- SQLBoolean.cs
- CheckBoxAutomationPeer.cs
- AssemblyBuilder.cs
- NgenServicingAttributes.cs
- NotSupportedException.cs
- HyperLink.cs
- MarginCollapsingState.cs
- TextBox.cs
- DataGridViewCellStyle.cs
- TitleStyle.cs
- XPathParser.cs
- WebPartManagerInternals.cs
- UpdateTranslator.cs
- TcpProcessProtocolHandler.cs
- ProtocolsConfigurationEntry.cs
- ValidationPropertyAttribute.cs
- DataControlLinkButton.cs
- HeaderLabel.cs
- XmlDesignerDataSourceView.cs
- EventProviderWriter.cs
- ObjectTag.cs
- AspCompat.cs
- DetailsViewDeleteEventArgs.cs
- AnonymousIdentificationModule.cs
- ClientSettingsProvider.cs
- XmlILOptimizerVisitor.cs
- DataSourceControlBuilder.cs
- EditorPartChrome.cs
- HandlerBase.cs
- SqlRowUpdatingEvent.cs
- LabelExpression.cs
- XPathBinder.cs
- EmbeddedMailObject.cs
- ToolStripRendererSwitcher.cs
- StorageEntityTypeMapping.cs
- DiffuseMaterial.cs
- AutomationPeer.cs
- WorkflowPersistenceService.cs
- BaseAsyncResult.cs
- TreeBuilderBamlTranslator.cs
- XmlIterators.cs
- ColumnClickEvent.cs
- DynamicValueConverter.cs
- ToolStripDropDownClosedEventArgs.cs
- XmlName.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- DataSourceSelectArguments.cs
- ServiceContractViewControl.Designer.cs
- TextServicesCompartment.cs
- Vector3DCollection.cs
- ImageButton.cs
- TextEditorMouse.cs
- ConnectionStringsSection.cs
- Evidence.cs
- MaterialCollection.cs