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
- ProfileEventArgs.cs
- TextInfo.cs
- CodePageUtils.cs
- HwndHostAutomationPeer.cs
- DataList.cs
- TextUtf8RawTextWriter.cs
- NativeMethods.cs
- FlowLayout.cs
- ConfigurationException.cs
- IsolatedStorageException.cs
- OleDbError.cs
- COMException.cs
- ActiveDocumentEvent.cs
- Int32RectConverter.cs
- XmlMemberMapping.cs
- Viewport2DVisual3D.cs
- TypeSystem.cs
- wgx_render.cs
- BitVec.cs
- WebPartConnectionsCloseVerb.cs
- ServiceActivationException.cs
- TablePatternIdentifiers.cs
- safemediahandle.cs
- filewebrequest.cs
- ClonableStack.cs
- MarkupCompilePass2.cs
- InputDevice.cs
- CodeGotoStatement.cs
- BStrWrapper.cs
- ClientSettingsSection.cs
- odbcmetadatafactory.cs
- TdsValueSetter.cs
- UInt32Storage.cs
- FormViewModeEventArgs.cs
- ConstNode.cs
- XmlBinaryReader.cs
- SqlDuplicator.cs
- Buffer.cs
- XmlEntity.cs
- LocationEnvironment.cs
- RequiredAttributeAttribute.cs
- SendActivityDesignerTheme.cs
- VBCodeProvider.cs
- TypeCodeDomSerializer.cs
- VisualTreeHelper.cs
- SplitterCancelEvent.cs
- TypeConverter.cs
- XmlDataImplementation.cs
- TripleDESCryptoServiceProvider.cs
- BaseDataListDesigner.cs
- LoadWorkflowCommand.cs
- SystemColors.cs
- ToolStripSettings.cs
- NativeMethods.cs
- shaperfactoryquerycacheentry.cs
- TraceHandler.cs
- CodeRegionDirective.cs
- MsmqAppDomainProtocolHandler.cs
- StringValidator.cs
- SourceSwitch.cs
- ExternalCalls.cs
- WebPartCollection.cs
- XmlILOptimizerVisitor.cs
- ScaleTransform3D.cs
- FlowNode.cs
- PackagingUtilities.cs
- Vector3D.cs
- datacache.cs
- TypeNameConverter.cs
- SamlSubject.cs
- VisualStateGroup.cs
- SchemaInfo.cs
- PkcsMisc.cs
- AnchoredBlock.cs
- DBNull.cs
- WebPartConnectionsConnectVerb.cs
- LocationEnvironment.cs
- Rectangle.cs
- GlobalizationSection.cs
- CounterSample.cs
- InvalidWMPVersionException.cs
- LinqExpressionNormalizer.cs
- SmiEventStream.cs
- XmlUtf8RawTextWriter.cs
- SamlAttributeStatement.cs
- RoutedPropertyChangedEventArgs.cs
- WebResourceAttribute.cs
- Pair.cs
- GroupBoxRenderer.cs
- CheckedListBox.cs
- ValidationErrorCollection.cs
- CodeAttributeDeclaration.cs
- DrawingBrush.cs
- Stopwatch.cs
- SortedDictionary.cs
- KeySplineConverter.cs
- ClockGroup.cs
- XmlBoundElement.cs
- ControlTemplate.cs
- NGCSerializer.cs