Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / MS / Internal / NamedObject.cs / 1305600 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Merger.cs
- AccessedThroughPropertyAttribute.cs
- HtmlShimManager.cs
- WebPartTracker.cs
- HttpWrapper.cs
- GridItem.cs
- UIElement.cs
- Span.cs
- TaskScheduler.cs
- CustomWebEventKey.cs
- _ScatterGatherBuffers.cs
- ActivityXRefPropertyEditor.cs
- ReceiveActivity.cs
- CompiledIdentityConstraint.cs
- TraceData.cs
- MobileUITypeEditor.cs
- DataView.cs
- IssuedTokenClientCredential.cs
- PaperSize.cs
- SqlTypeSystemProvider.cs
- FormViewPageEventArgs.cs
- ErrorWrapper.cs
- NumberSubstitution.cs
- DeferredSelectedIndexReference.cs
- ListControlBuilder.cs
- CodeSnippetTypeMember.cs
- sqlmetadatafactory.cs
- ChannelBuilder.cs
- TriggerBase.cs
- DataTableExtensions.cs
- XmlSchemaInclude.cs
- TypeHelper.cs
- ObjectQuery.cs
- TreeIterator.cs
- QilFunction.cs
- SiteOfOriginContainer.cs
- SecureUICommand.cs
- DefinitionBase.cs
- _ChunkParse.cs
- EntityTypeEmitter.cs
- NativeMethods.cs
- ToolStripItem.cs
- SelectionPattern.cs
- ArcSegment.cs
- Sorting.cs
- DataGridRowsPresenter.cs
- DataListDesigner.cs
- ToolStripMenuItem.cs
- LabelDesigner.cs
- Suspend.cs
- VectorAnimation.cs
- CheckBoxPopupAdapter.cs
- SqlWorkflowPersistenceService.cs
- Propagator.Evaluator.cs
- XNodeValidator.cs
- PriorityBinding.cs
- SByteStorage.cs
- StateDesigner.cs
- Speller.cs
- MeasurementDCInfo.cs
- PointKeyFrameCollection.cs
- PopOutPanel.cs
- TextShapeableCharacters.cs
- PathNode.cs
- PasswordBox.cs
- NominalTypeEliminator.cs
- NameValueConfigurationElement.cs
- _IPv6Address.cs
- COM2ExtendedBrowsingHandler.cs
- SignedPkcs7.cs
- WorkflowInstanceExtensionManager.cs
- InvokeMemberBinder.cs
- WorkflowWebHostingModule.cs
- UnmanagedMemoryStreamWrapper.cs
- Wildcard.cs
- CallbackHandler.cs
- BinHexEncoding.cs
- GeneralTransform3D.cs
- WmlPhoneCallAdapter.cs
- HeaderedContentControl.cs
- ChtmlFormAdapter.cs
- ClipboardData.cs
- Rotation3DKeyFrameCollection.cs
- OutputCacheSettingsSection.cs
- SqlClientFactory.cs
- AsnEncodedData.cs
- WsatConfiguration.cs
- MemberJoinTreeNode.cs
- JavaScriptSerializer.cs
- MenuDesigner.cs
- AsymmetricAlgorithm.cs
- LayoutInformation.cs
- DataServiceContext.cs
- controlskin.cs
- HtmlCommandAdapter.cs
- SolidBrush.cs
- CustomErrorCollection.cs
- RangeValuePattern.cs
- XamlReaderHelper.cs
- hwndwrapper.cs