Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / MS / Internal / NamedObject.cs / 1305600 / NamedObject.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: Placeholder object, with a name that appears in the debugger // //--------------------------------------------------------------------------- using System; using System.Globalization; using MS.Internal.WindowsBase; namespace MS.Internal { ////// An instance of this class can be used wherever you might otherwise use /// "new Object()". The name will show up in the debugger, instead of /// merely "{object}" /// [FriendAccessAllowed] // Built into Base, also used by Framework. internal class NamedObject { public NamedObject(string name) { if (String.IsNullOrEmpty(name)) throw new ArgumentNullException(name); _name = name; } public override string ToString() { if (_name[0] != '{') { // lazily add {} around the name, to avoid allocating a string // until it's actually needed _name = String.Format(CultureInfo.InvariantCulture, "{{{0}}}", _name); } return _name; } string _name; } } // 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
- UnknownBitmapDecoder.cs
- TemplateXamlTreeBuilder.cs
- HorizontalAlignConverter.cs
- CngAlgorithm.cs
- CdpEqualityComparer.cs
- InvokeGenerator.cs
- CommandBindingCollection.cs
- SqlDataReaderSmi.cs
- DecoderReplacementFallback.cs
- SqlDataSourceView.cs
- SettingsSection.cs
- RNGCryptoServiceProvider.cs
- ConfigsHelper.cs
- RightNameExpirationInfoPair.cs
- Trace.cs
- Bits.cs
- Propagator.ExtentPlaceholderCreator.cs
- UndoManager.cs
- PackagingUtilities.cs
- FileIOPermission.cs
- EdmItemCollection.cs
- CombinedGeometry.cs
- SchemeSettingElement.cs
- SecurityTokenContainer.cs
- DictionaryEntry.cs
- LogicalExpr.cs
- ObjectDataSourceStatusEventArgs.cs
- PropertyEntry.cs
- LinkConverter.cs
- ScrollItemPattern.cs
- StaticResourceExtension.cs
- SecureStringHasher.cs
- ErrorFormatterPage.cs
- TdsParserHelperClasses.cs
- NeutralResourcesLanguageAttribute.cs
- XPathDocument.cs
- _RequestCacheProtocol.cs
- QilGeneratorEnv.cs
- TransformedBitmap.cs
- SettingsPropertyCollection.cs
- TraceSource.cs
- ExpressionDumper.cs
- ColumnResult.cs
- VectorCollectionValueSerializer.cs
- ToolStripDropDown.cs
- RichTextBoxAutomationPeer.cs
- UnsafeNativeMethodsMilCoreApi.cs
- DataGridViewMethods.cs
- PeerHopCountAttribute.cs
- EllipseGeometry.cs
- CodeMemberField.cs
- MissingSatelliteAssemblyException.cs
- FixedPageStructure.cs
- DBCommand.cs
- shaper.cs
- VirtualPathUtility.cs
- JsonMessageEncoderFactory.cs
- Panel.cs
- ProvidePropertyAttribute.cs
- SchemaNames.cs
- GlobalizationSection.cs
- ColorConvertedBitmap.cs
- UnsafeNativeMethods.cs
- ResourceCategoryAttribute.cs
- TextRangeEditTables.cs
- parserscommon.cs
- ProfilePropertySettings.cs
- LabelAutomationPeer.cs
- OleDbException.cs
- FolderBrowserDialog.cs
- RequestReplyCorrelator.cs
- ObjectListCommandCollection.cs
- HyperLinkStyle.cs
- SqlStream.cs
- ExternalCalls.cs
- CodeExpressionStatement.cs
- ConnectorSelectionGlyph.cs
- MappingException.cs
- PeerName.cs
- MergablePropertyAttribute.cs
- ContentPosition.cs
- StaticDataManager.cs
- ConfigXmlSignificantWhitespace.cs
- TimeSpan.cs
- DataGridViewRowHeaderCell.cs
- MetaChildrenColumn.cs
- RuleSettings.cs
- FontFamily.cs
- DateTimeOffsetStorage.cs
- COAUTHIDENTITY.cs
- AspNetHostingPermission.cs
- EventHandlersStore.cs
- SymbolPair.cs
- LineServices.cs
- followingsibling.cs
- ColumnWidthChangingEvent.cs
- SiteMapProvider.cs
- columnmapfactory.cs
- PreloadedPackages.cs
- HtmlForm.cs