Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // //// 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
- BitmapImage.cs
- StrokeFIndices.cs
- FontSizeConverter.cs
- OleDragDropHandler.cs
- UnmanagedBitmapWrapper.cs
- Underline.cs
- HMACSHA1.cs
- InheritablePropertyChangeInfo.cs
- ZipPackage.cs
- OleDbRowUpdatingEvent.cs
- TreeViewDataItemAutomationPeer.cs
- XXXInfos.cs
- DoubleCollection.cs
- AliasedSlot.cs
- MbpInfo.cs
- SharedConnectionWorkflowTransactionService.cs
- EncodingDataItem.cs
- SimpleWebHandlerParser.cs
- ConfigurationSchemaErrors.cs
- OdbcConnection.cs
- ObjectCacheSettings.cs
- Publisher.cs
- TrackBar.cs
- DataGridRowEventArgs.cs
- XmlHierarchyData.cs
- Splitter.cs
- CodeMemberField.cs
- RangeValidator.cs
- ProcessInfo.cs
- ResourcesGenerator.cs
- DbParameterCollectionHelper.cs
- DecimalStorage.cs
- EdmMember.cs
- EditingCoordinator.cs
- EntityDataSourceWrapperCollection.cs
- Directory.cs
- Cursors.cs
- QilValidationVisitor.cs
- Latin1Encoding.cs
- SubstitutionResponseElement.cs
- AdapterUtil.cs
- DbProviderSpecificTypePropertyAttribute.cs
- TimelineClockCollection.cs
- SQLChars.cs
- ToolboxItem.cs
- ApplicationId.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- BamlMapTable.cs
- CookielessHelper.cs
- PermissionSetTriple.cs
- GraphicsState.cs
- TranslateTransform.cs
- FusionWrap.cs
- ComponentResourceKeyConverter.cs
- WebPartExportVerb.cs
- ParameterBinding.cs
- Rect3DConverter.cs
- EmptyEnumerator.cs
- MasterPageParser.cs
- SafeMarshalContext.cs
- ToolStripRendererSwitcher.cs
- UInt16.cs
- XPathSelfQuery.cs
- PropertyGroupDescription.cs
- DecoderBestFitFallback.cs
- QueueSurrogate.cs
- TCPClient.cs
- HtmlButton.cs
- SQLCharsStorage.cs
- HandoffBehavior.cs
- DefaultEventAttribute.cs
- _BufferOffsetSize.cs
- DesignerView.cs
- ImportContext.cs
- GrammarBuilderPhrase.cs
- SwitchAttribute.cs
- OciLobLocator.cs
- ImageKeyConverter.cs
- SafeArrayRankMismatchException.cs
- GPStream.cs
- EncryptedType.cs
- ValidationHelper.cs
- HitTestParameters3D.cs
- VirtualizedItemProviderWrapper.cs
- DbConnectionOptions.cs
- ConvertEvent.cs
- ClickablePoint.cs
- RelativeSource.cs
- MarginCollapsingState.cs
- TreeView.cs
- Codec.cs
- SplitContainer.cs
- StatusBarDrawItemEvent.cs
- MouseGesture.cs
- InertiaTranslationBehavior.cs
- DetailsViewUpdateEventArgs.cs
- unitconverter.cs
- MobileUserControl.cs
- CodeEventReferenceExpression.cs
- CustomBindingElementCollection.cs