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
- QilInvokeLateBound.cs
- PropertyInfoSet.cs
- ByteStreamMessageUtility.cs
- Trigger.cs
- HybridDictionary.cs
- CellIdBoolean.cs
- ColumnReorderedEventArgs.cs
- Dynamic.cs
- ProviderCommandInfoUtils.cs
- CollectionViewProxy.cs
- EqualityComparer.cs
- TCEAdapterGenerator.cs
- BuildDependencySet.cs
- TabletDeviceInfo.cs
- SqlNodeAnnotations.cs
- SmtpTransport.cs
- SourceSwitch.cs
- MoveSizeWinEventHandler.cs
- ServiceDescriptions.cs
- GestureRecognitionResult.cs
- BackStopAuthenticationModule.cs
- SynchronizingStream.cs
- ErrorTolerantObjectWriter.cs
- WindowsToolbarItemAsMenuItem.cs
- SharedStatics.cs
- ReferentialConstraint.cs
- processwaithandle.cs
- ObjectTag.cs
- BaseTreeIterator.cs
- FloaterParaClient.cs
- FileSystemEventArgs.cs
- XmlHierarchicalEnumerable.cs
- XmlMtomReader.cs
- _IPv6Address.cs
- InstanceDataCollectionCollection.cs
- UnhandledExceptionEventArgs.cs
- BamlWriter.cs
- HtmlWindowCollection.cs
- ProgressBar.cs
- SupportingTokenProviderSpecification.cs
- DataGridViewComponentPropertyGridSite.cs
- SqlDependencyUtils.cs
- SqlNodeAnnotation.cs
- ModelItemDictionaryImpl.cs
- DataGridTableCollection.cs
- UdpChannelFactory.cs
- EventMappingSettings.cs
- ProfileSection.cs
- TreeNodeConverter.cs
- ImageListStreamer.cs
- PointAnimationClockResource.cs
- DataGridToolTip.cs
- XmlNodeChangedEventArgs.cs
- BevelBitmapEffect.cs
- Vector3DCollectionConverter.cs
- TextModifier.cs
- BindValidator.cs
- RelationshipDetailsRow.cs
- ExpressionVisitor.cs
- AggregationMinMaxHelpers.cs
- CustomMenuItemCollection.cs
- HtmlEncodedRawTextWriter.cs
- DataGridViewCellStyle.cs
- NonParentingControl.cs
- CurrencyWrapper.cs
- coordinatorfactory.cs
- CommandSet.cs
- TableStyle.cs
- ParameterBuilder.cs
- InstanceStoreQueryResult.cs
- MethodCallTranslator.cs
- EditorZoneBase.cs
- _LocalDataStoreMgr.cs
- ArgumentValidation.cs
- UmAlQuraCalendar.cs
- BitmapEffectGroup.cs
- ParentUndoUnit.cs
- SyndicationLink.cs
- SoapReflectionImporter.cs
- ScrollData.cs
- SizeValueSerializer.cs
- Brush.cs
- MonikerHelper.cs
- WmlTextViewAdapter.cs
- JsonServiceDocumentSerializer.cs
- ConfigurationElementProperty.cs
- Quaternion.cs
- RawStylusInputCustomDataList.cs
- arclist.cs
- DesignBindingEditor.cs
- MessageUtil.cs
- DiscoveryMessageSequence.cs
- FocusTracker.cs
- DataSourceSelectArguments.cs
- UnknownWrapper.cs
- PreservationFileWriter.cs
- CommandManager.cs
- PeerObject.cs
- XmlTextWriter.cs
- WebExceptionStatus.cs