Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / WinForms / Managed / System / WinForms / WinCategoryAttribute.cs / 1 / WinCategoryAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms { using System; using System.ComponentModel; using System.Diagnostics; ////// /// /// [AttributeUsage(AttributeTargets.All)] internal sealed class WinCategoryAttribute : CategoryAttribute { ////// CategoryAttribute that can access WinForms localized strings. /// ////// /// public WinCategoryAttribute(string category) : base(category) { } ////// Initializes a new instance of the ///class. /// /// /// This method is called the first time the category property /// is accessed. It provides a way to lookup a localized string for /// the given category. Classes may override this to add their /// own localized names to categories. If a localized string is /// available for the given value, the method should return it. /// Otherwise, it should return null. /// protected override string GetLocalizedString(string value) { string localizedValue = base.GetLocalizedString(value); if (localizedValue == null) { localizedValue = (string)SR.GetObject("WinFormsCategory" + value); } // This attribute is internal, and we should never have a missing resource string. // Debug.Assert(localizedValue != null, "All Windows Forms category attributes should have localized strings. Category '" + value + "' not found."); return localizedValue; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms { using System; using System.ComponentModel; using System.Diagnostics; ////// /// /// [AttributeUsage(AttributeTargets.All)] internal sealed class WinCategoryAttribute : CategoryAttribute { ////// CategoryAttribute that can access WinForms localized strings. /// ////// /// public WinCategoryAttribute(string category) : base(category) { } ////// Initializes a new instance of the ///class. /// /// /// This method is called the first time the category property /// is accessed. It provides a way to lookup a localized string for /// the given category. Classes may override this to add their /// own localized names to categories. If a localized string is /// available for the given value, the method should return it. /// Otherwise, it should return null. /// protected override string GetLocalizedString(string value) { string localizedValue = base.GetLocalizedString(value); if (localizedValue == null) { localizedValue = (string)SR.GetObject("WinFormsCategory" + value); } // This attribute is internal, and we should never have a missing resource string. // Debug.Assert(localizedValue != null, "All Windows Forms category attributes should have localized strings. Category '" + value + "' not found."); return localizedValue; } } } // 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
- PartialCachingAttribute.cs
- CodeIdentifiers.cs
- HelpExampleGenerator.cs
- XmlSchemaValidationException.cs
- ActivityFunc.cs
- UpdateExpressionVisitor.cs
- AuthorizationPolicyTypeElement.cs
- PaperSource.cs
- ActivationArguments.cs
- BufferAllocator.cs
- DateTimeFormat.cs
- linebase.cs
- XmlMemberMapping.cs
- ColumnResult.cs
- Publisher.cs
- XmlSignificantWhitespace.cs
- messageonlyhwndwrapper.cs
- DesignerProperties.cs
- StreamAsIStream.cs
- OracleTimeSpan.cs
- SecUtil.cs
- EncoderParameter.cs
- ViewgenContext.cs
- ReflectTypeDescriptionProvider.cs
- ColorConvertedBitmapExtension.cs
- StylusCaptureWithinProperty.cs
- TextWriter.cs
- dataprotectionpermissionattribute.cs
- FormsAuthentication.cs
- HttpCookieCollection.cs
- MailHeaderInfo.cs
- LinqDataSourceEditData.cs
- ListViewItemEventArgs.cs
- OdbcEnvironment.cs
- COM2ComponentEditor.cs
- SystemGatewayIPAddressInformation.cs
- BindingContext.cs
- PropertyNames.cs
- TransformConverter.cs
- OdbcStatementHandle.cs
- TemplateControlBuildProvider.cs
- DataGridAddNewRow.cs
- NativeRightsManagementAPIsStructures.cs
- DiscreteKeyFrames.cs
- OutputBuffer.cs
- PageParserFilter.cs
- StringSorter.cs
- XpsS0ValidatingLoader.cs
- SafeNativeMethodsMilCoreApi.cs
- DbDataSourceEnumerator.cs
- PenThreadPool.cs
- SafeNativeMethods.cs
- HotSpotCollection.cs
- HttpChannelBindingToken.cs
- TreeViewItem.cs
- List.cs
- TopClause.cs
- CodeMemberProperty.cs
- ProgressiveCrcCalculatingStream.cs
- isolationinterop.cs
- DbConnectionFactory.cs
- ImmutableObjectAttribute.cs
- Int32AnimationBase.cs
- DesignerDataTableBase.cs
- InputScopeAttribute.cs
- PrtTicket_Base.cs
- XmlSerializerFactory.cs
- UDPClient.cs
- SystemFonts.cs
- IndexerNameAttribute.cs
- ColumnHeaderConverter.cs
- PathGradientBrush.cs
- XamlTemplateSerializer.cs
- GcHandle.cs
- ApplicationBuildProvider.cs
- AssertUtility.cs
- XmlNullResolver.cs
- ProgressBarRenderer.cs
- XPathDocument.cs
- DetailsViewInsertEventArgs.cs
- EventArgs.cs
- WebControlAdapter.cs
- SevenBitStream.cs
- LogConverter.cs
- UnauthorizedAccessException.cs
- UnsafeNativeMethods.cs
- ApplicationBuildProvider.cs
- BufferedStream.cs
- ScriptReferenceBase.cs
- DoubleAnimationUsingPath.cs
- UriWriter.cs
- KoreanLunisolarCalendar.cs
- EmbeddedMailObjectsCollection.cs
- EmptyControlCollection.cs
- HtmlTitle.cs
- KeyboardNavigation.cs
- UInt64.cs
- SerializableTypeCodeDomSerializer.cs
- UnsafePeerToPeerMethods.cs
- TreeNodeCollection.cs