Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- CancelEventArgs.cs
- RewritingValidator.cs
- CodeTypeReference.cs
- FontWeightConverter.cs
- CompressedStack.cs
- PersistChildrenAttribute.cs
- ObjectMemberMapping.cs
- GeneralTransform2DTo3D.cs
- Math.cs
- SQLInt16Storage.cs
- ClientType.cs
- DataGrid.cs
- EntityModelSchemaGenerator.cs
- SvcMapFileSerializer.cs
- Image.cs
- ComplexType.cs
- TypeReference.cs
- PublishLicense.cs
- DataControlField.cs
- MemberMaps.cs
- NamespaceTable.cs
- DirectionalLight.cs
- TraceSection.cs
- BookmarkEventArgs.cs
- DoubleUtil.cs
- ObjectResult.cs
- DataGridViewCellCancelEventArgs.cs
- SafeEventHandle.cs
- NetworkCredential.cs
- FaultImportOptions.cs
- ConnectionManagementSection.cs
- TraceContext.cs
- WebPartEventArgs.cs
- SmtpNegotiateAuthenticationModule.cs
- TextParaLineResult.cs
- DrawingContextDrawingContextWalker.cs
- MetadataStore.cs
- CatalogPartChrome.cs
- TreeView.cs
- VectorCollectionConverter.cs
- ServiceActivationException.cs
- Vector3DAnimationUsingKeyFrames.cs
- IssuanceLicense.cs
- CfgParser.cs
- Publisher.cs
- _NegoStream.cs
- XmlWellformedWriter.cs
- MetabaseServerConfig.cs
- XmlSchemaValidator.cs
- ModelFunctionTypeElement.cs
- DocumentOrderQuery.cs
- RangeExpression.cs
- PaintEvent.cs
- TraceAsyncResult.cs
- dbenumerator.cs
- ObjectFullSpanRewriter.cs
- Point3DConverter.cs
- ComponentChangedEvent.cs
- DataGridViewColumnDesigner.cs
- EntityContainerEmitter.cs
- XmlEntityReference.cs
- XmlSerializerSection.cs
- SignedXmlDebugLog.cs
- LassoSelectionBehavior.cs
- SocketInformation.cs
- BaseValidatorDesigner.cs
- HatchBrush.cs
- ObjectDataProvider.cs
- SqlDependency.cs
- SQLUtility.cs
- BrushValueSerializer.cs
- TypeLoadException.cs
- TableLayoutPanelCellPosition.cs
- WebPartZone.cs
- XmlAttributeCollection.cs
- ExtensionSimplifierMarkupObject.cs
- WindowsTokenRoleProvider.cs
- AtomicFile.cs
- List.cs
- URLIdentityPermission.cs
- WebPartCollection.cs
- HtmlControl.cs
- LinqToSqlWrapper.cs
- X509ScopedServiceCertificateElement.cs
- ConnectionPoolManager.cs
- ResXResourceWriter.cs
- WinEventTracker.cs
- PermissionSetEnumerator.cs
- FileRecordSequenceHelper.cs
- OutputCacheModule.cs
- ApplicationException.cs
- ConnectionPoolManager.cs
- Image.cs
- Rotation3D.cs
- XmlNode.cs
- RsaSecurityKey.cs
- _SslState.cs
- LinkDescriptor.cs
- ResXFileRef.cs
- DataObjectPastingEventArgs.cs