Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Base / MS / Internal / NamedObject.cs / 1 / 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. //---------------------------------------------------------------------------- // //// 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
- ErrorFormatterPage.cs
- NameTable.cs
- KeyedCollection.cs
- DataSourceUtil.cs
- sqlnorm.cs
- LongTypeConverter.cs
- TextEditorTyping.cs
- DrawingBrush.cs
- ScriptingJsonSerializationSection.cs
- DesignSurfaceServiceContainer.cs
- PermissionListSet.cs
- XamlSerializerUtil.cs
- SelectedCellsCollection.cs
- ControlAdapter.cs
- JournalEntryStack.cs
- AppDomainFactory.cs
- NumericUpDownAccelerationCollection.cs
- DataGridViewIntLinkedList.cs
- ObjectDataSourceMethodEventArgs.cs
- DebugControllerThread.cs
- ImageFormat.cs
- ResetableIterator.cs
- DiscoveryRequestHandler.cs
- TextWriter.cs
- TransactionContextValidator.cs
- ComponentGlyph.cs
- AttachedAnnotation.cs
- DataGridColumnCollectionEditor.cs
- ObjectConverter.cs
- MailDefinitionBodyFileNameEditor.cs
- DetailsViewRow.cs
- KeyEventArgs.cs
- SystemIPv4InterfaceProperties.cs
- FolderLevelBuildProviderCollection.cs
- MemoryStream.cs
- CustomAttributeSerializer.cs
- XmlCharCheckingReader.cs
- CodeNamespace.cs
- PeerNameRecord.cs
- DataGridItem.cs
- DoubleLinkListEnumerator.cs
- StorageTypeMapping.cs
- WebPartCancelEventArgs.cs
- CompoundFileDeflateTransform.cs
- RequestCachePolicyConverter.cs
- AuthenticationConfig.cs
- RegistrySecurity.cs
- WebRequest.cs
- NamedPermissionSet.cs
- DtcInterfaces.cs
- ListViewItem.cs
- ValidatingReaderNodeData.cs
- XmlNamespaceMappingCollection.cs
- CodeExporter.cs
- DataGridItemEventArgs.cs
- ValidationEventArgs.cs
- StorageAssociationTypeMapping.cs
- Attributes.cs
- NavigationExpr.cs
- DataGridToolTip.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- CallbackValidator.cs
- XPathNavigator.cs
- SqlTypeSystemProvider.cs
- CipherData.cs
- SqlMethods.cs
- WebServiceReceiveDesigner.cs
- HttpCacheVary.cs
- OdbcParameterCollection.cs
- EncodingConverter.cs
- InplaceBitmapMetadataWriter.cs
- PersianCalendar.cs
- StyleModeStack.cs
- WebMessageFormatHelper.cs
- QilSortKey.cs
- ThreadAttributes.cs
- ZipIOCentralDirectoryBlock.cs
- ElementAction.cs
- ObjectHandle.cs
- SizeKeyFrameCollection.cs
- MappingItemCollection.cs
- EntityDataSourceContainerNameItem.cs
- MainMenu.cs
- AssemblySettingAttributes.cs
- WinFormsSpinner.cs
- TrackingLocationCollection.cs
- XmlException.cs
- TextView.cs
- TreeWalker.cs
- TextTreeInsertElementUndoUnit.cs
- SqlDataReader.cs
- WmlImageAdapter.cs
- XPathDocument.cs
- ScriptingWebServicesSectionGroup.cs
- _ListenerResponseStream.cs
- TextRangeAdaptor.cs
- Pool.cs
- XmlSortKeyAccumulator.cs
- FeatureManager.cs
- LinqToSqlWrapper.cs