Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- FileDialogCustomPlacesCollection.cs
- figurelengthconverter.cs
- DbParameterCollectionHelper.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- ClientSponsor.cs
- MetadataItemEmitter.cs
- TextRangeEdit.cs
- IdnElement.cs
- Point3D.cs
- DataFieldConverter.cs
- BitmapEffect.cs
- KnownColorTable.cs
- OdbcDataAdapter.cs
- AttachmentCollection.cs
- TypefaceMetricsCache.cs
- X509Chain.cs
- StrokeNodeData.cs
- LogEntryHeaderDeserializer.cs
- CookielessData.cs
- SupportingTokenDuplexChannel.cs
- ValidatorCollection.cs
- PerformanceCountersElement.cs
- MemberMaps.cs
- ManagementInstaller.cs
- SchemaImporterExtensionElementCollection.cs
- UserNameSecurityTokenProvider.cs
- MenuItemCollectionEditorDialog.cs
- ObjectDataSourceView.cs
- UseAttributeSetsAction.cs
- ColorAnimationUsingKeyFrames.cs
- DaylightTime.cs
- BitmapEditor.cs
- FileDialog.cs
- WebPartCatalogCloseVerb.cs
- ButtonRenderer.cs
- HGlobalSafeHandle.cs
- HasCopySemanticsAttribute.cs
- SplayTreeNode.cs
- StringDictionaryEditor.cs
- QueryOperationResponseOfT.cs
- UniqueConstraint.cs
- ObjectListCommandCollection.cs
- CookieProtection.cs
- NamedPipeConnectionPool.cs
- SqlWebEventProvider.cs
- ClockGroup.cs
- OutputCacheSettingsSection.cs
- RtfToXamlReader.cs
- GridViewColumn.cs
- MILUtilities.cs
- ContentTextAutomationPeer.cs
- XPathSingletonIterator.cs
- StandardRuntimeEnumValidatorAttribute.cs
- DataRow.cs
- ImageCodecInfo.cs
- ParserContext.cs
- RangeValuePattern.cs
- NamespaceDecl.cs
- Journaling.cs
- TransportConfigurationTypeElementCollection.cs
- AsymmetricCryptoHandle.cs
- ConsumerConnectionPointCollection.cs
- ListBindingHelper.cs
- elementinformation.cs
- FunctionParameter.cs
- TableLayout.cs
- Padding.cs
- SqlInternalConnectionTds.cs
- MailWriter.cs
- DnsEndpointIdentity.cs
- UniqueEventHelper.cs
- DataControlImageButton.cs
- CustomAttributeBuilder.cs
- DBSchemaTable.cs
- PropertyChangingEventArgs.cs
- ValueHandle.cs
- RadioButtonAutomationPeer.cs
- EventProviderTraceListener.cs
- DataTablePropertyDescriptor.cs
- XmlEntityReference.cs
- InnerItemCollectionView.cs
- BamlVersionHeader.cs
- _RequestCacheProtocol.cs
- ReadWriteSpinLock.cs
- StyleReferenceConverter.cs
- OrderPreservingPipeliningMergeHelper.cs
- ErrorWrapper.cs
- SoapFault.cs
- EmulateRecognizeCompletedEventArgs.cs
- UpDownBase.cs
- DataObjectEventArgs.cs
- EpmTargetTree.cs
- IISUnsafeMethods.cs
- DataTableCollection.cs
- ObjectList.cs
- CloudCollection.cs
- PopupEventArgs.cs
- TypeResolvingOptions.cs
- Expander.cs
- AnonymousIdentificationSection.cs