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
- TreeViewImageIndexConverter.cs
- Substitution.cs
- ExeConfigurationFileMap.cs
- OdbcDataReader.cs
- ContextMarshalException.cs
- WinEventTracker.cs
- Faults.cs
- SchemaElement.cs
- ContextBase.cs
- SHA1Managed.cs
- Boolean.cs
- LocatorBase.cs
- XmlWriterTraceListener.cs
- RTLAwareMessageBox.cs
- GatewayIPAddressInformationCollection.cs
- CalendarDay.cs
- FixedSOMTableCell.cs
- RepeatButton.cs
- ControlBindingsCollection.cs
- SqlServices.cs
- CompleteWizardStep.cs
- LiteralControl.cs
- SystemBrushes.cs
- CompilerLocalReference.cs
- ColumnHeaderCollectionEditor.cs
- DesignerWidgets.cs
- FormatConvertedBitmap.cs
- SrgsElementList.cs
- XmlMtomReader.cs
- DataGridViewCellValidatingEventArgs.cs
- ToolStripControlHost.cs
- ObjectDataSourceSelectingEventArgs.cs
- QuaternionAnimation.cs
- XmlWellformedWriterHelpers.cs
- CompensationDesigner.cs
- XmlSchemaFacet.cs
- EditorPartCollection.cs
- DerivedKeySecurityToken.cs
- StreamMarshaler.cs
- GeometryValueSerializer.cs
- Metadata.cs
- GeometryModel3D.cs
- RowToParametersTransformer.cs
- DocumentViewerHelper.cs
- MaskInputRejectedEventArgs.cs
- RayHitTestParameters.cs
- InitializerFacet.cs
- DatePicker.cs
- HttpContext.cs
- DataPointer.cs
- UrlPath.cs
- PeerNameRegistration.cs
- FrameworkContextData.cs
- ReflectEventDescriptor.cs
- InternalCache.cs
- XPathScanner.cs
- SqlBuffer.cs
- TextSelectionHelper.cs
- TextEffect.cs
- FontFamilyIdentifier.cs
- QueryResultOp.cs
- ByteStorage.cs
- RightsManagementEncryptedStream.cs
- SmiConnection.cs
- FontCollection.cs
- X509InitiatorCertificateClientElement.cs
- StringResourceManager.cs
- ExternalException.cs
- TextRangeEdit.cs
- BuildManagerHost.cs
- BaseCollection.cs
- Matrix.cs
- OpenTypeLayoutCache.cs
- ListenerElementsCollection.cs
- ListViewInsertEventArgs.cs
- NoResizeHandleGlyph.cs
- DataGridCommandEventArgs.cs
- CollectionChangeEventArgs.cs
- DataGridViewElement.cs
- storagemappingitemcollection.viewdictionary.cs
- Int32CAMarshaler.cs
- SettingsPropertyNotFoundException.cs
- ResourceDescriptionAttribute.cs
- MultipartIdentifier.cs
- CorrelationValidator.cs
- RowUpdatedEventArgs.cs
- BuildProviderAppliesToAttribute.cs
- DBConnectionString.cs
- FixedFlowMap.cs
- Point4DConverter.cs
- ScriptResourceInfo.cs
- RuntimeHelpers.cs
- ScrollBarAutomationPeer.cs
- WorkflowMessageEventHandler.cs
- SafeNativeMethods.cs
- BinaryParser.cs
- PersistenceProviderElement.cs
- ConnectionManagementElement.cs
- Behavior.cs
- DbSourceCommand.cs