Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ISCIIEncoding.cs
- WaitForChangedResult.cs
- SQLGuidStorage.cs
- ProbeDuplexCD1AsyncResult.cs
- ValidationError.cs
- UnsafeNativeMethods.cs
- ActivityUtilities.cs
- StringConverter.cs
- PrinterUnitConvert.cs
- AdjustableArrowCap.cs
- CodeVariableDeclarationStatement.cs
- CipherData.cs
- NumericUpDownAccelerationCollection.cs
- XmlMembersMapping.cs
- DataPagerFieldItem.cs
- NullableConverter.cs
- MetadataProperty.cs
- IncrementalHitTester.cs
- WbmpConverter.cs
- DrawTreeNodeEventArgs.cs
- RtType.cs
- ThreadAttributes.cs
- SecurityUtils.cs
- GridPatternIdentifiers.cs
- SystemPens.cs
- ConfigurationManagerInternalFactory.cs
- MemoryMappedFileSecurity.cs
- DrawingDrawingContext.cs
- XPathDocument.cs
- IncrementalReadDecoders.cs
- TextOptionsInternal.cs
- TextEndOfLine.cs
- DesignerAdRotatorAdapter.cs
- NameScopePropertyAttribute.cs
- HandlerMappingMemo.cs
- MruCache.cs
- ControlEvent.cs
- ImplicitInputBrush.cs
- ApplicationInfo.cs
- XmlIncludeAttribute.cs
- MouseGesture.cs
- WindowsFormsHostAutomationPeer.cs
- MimeReturn.cs
- DataGridViewRowsRemovedEventArgs.cs
- XmlFormatWriterGenerator.cs
- OdbcConnectionHandle.cs
- CryptoKeySecurity.cs
- EventLogEntry.cs
- CoTaskMemHandle.cs
- WorkflowRuntimeServiceElementCollection.cs
- TextParaClient.cs
- ServiceHostFactory.cs
- XmlNamespaceDeclarationsAttribute.cs
- FixedPage.cs
- Keywords.cs
- LinqDataSourceEditData.cs
- XmlRawWriter.cs
- util.cs
- VirtualPathProvider.cs
- GridItemPattern.cs
- ResourceDescriptionAttribute.cs
- DocumentViewerBase.cs
- StickyNoteAnnotations.cs
- ContentWrapperAttribute.cs
- SmiGettersStream.cs
- XmlBoundElement.cs
- bidPrivateBase.cs
- ReflectEventDescriptor.cs
- TableRowCollection.cs
- TrackBarRenderer.cs
- TableLayoutCellPaintEventArgs.cs
- SelectionChangedEventArgs.cs
- InternalMappingException.cs
- Util.cs
- UnSafeCharBuffer.cs
- DocumentGridPage.cs
- ToolstripProfessionalRenderer.cs
- RoleGroupCollection.cs
- BindingOperations.cs
- ConditionalWeakTable.cs
- TypeBuilderInstantiation.cs
- ContainerActivationHelper.cs
- DependencyObject.cs
- SchemaElementDecl.cs
- Win32SafeHandles.cs
- ApplicationContext.cs
- Line.cs
- DataSourceCacheDurationConverter.cs
- DebugHandleTracker.cs
- BamlBinaryReader.cs
- Vars.cs
- Utils.cs
- RealizationDrawingContextWalker.cs
- ExtensionWindowResizeGrip.cs
- EntityDataSourceContextDisposingEventArgs.cs
- TextSegment.cs
- MexHttpBindingCollectionElement.cs
- FreezableCollection.cs
- LineServicesCallbacks.cs
- NotifyIcon.cs