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
- EncryptedXml.cs
- GlobalEventManager.cs
- ToolStripStatusLabel.cs
- ConstructorArgumentAttribute.cs
- FileLogRecordStream.cs
- BlockCollection.cs
- VectorKeyFrameCollection.cs
- BezierSegment.cs
- Dynamic.cs
- indexingfiltermarshaler.cs
- JournalEntry.cs
- ReliableRequestSessionChannel.cs
- TaiwanCalendar.cs
- VerificationAttribute.cs
- SqlWebEventProvider.cs
- EncodingInfo.cs
- TextSearch.cs
- ViewManager.cs
- xmlfixedPageInfo.cs
- FilterEventArgs.cs
- UnsafeNativeMethods.cs
- EdmToObjectNamespaceMap.cs
- ObjectConverter.cs
- BlockUIContainer.cs
- TextRangeEditLists.cs
- NopReturnReader.cs
- WSSecurityPolicy12.cs
- LocalizedNameDescriptionPair.cs
- MetadataItemCollectionFactory.cs
- SelectionRange.cs
- FontNamesConverter.cs
- CodeArrayCreateExpression.cs
- UIElementAutomationPeer.cs
- WebPartConnectionCollection.cs
- OAVariantLib.cs
- DynamicFilter.cs
- Color.cs
- Bookmark.cs
- BufferedGraphics.cs
- ChannelSinkStacks.cs
- EditorZone.cs
- SrgsElementFactoryCompiler.cs
- ChildDocumentBlock.cs
- _SingleItemRequestCache.cs
- Utils.cs
- ConnectionStringSettings.cs
- DbExpressionRules.cs
- DataRecord.cs
- UpdateManifestForBrowserApplication.cs
- Visual.cs
- XmlBindingWorker.cs
- SystemIPAddressInformation.cs
- ListManagerBindingsCollection.cs
- WebPartDescriptionCollection.cs
- SqlUserDefinedAggregateAttribute.cs
- CustomCategoryAttribute.cs
- Group.cs
- EvidenceTypeDescriptor.cs
- WebConfigurationHostFileChange.cs
- TextEditorCharacters.cs
- CompoundFileReference.cs
- StringAttributeCollection.cs
- DefinitionUpdate.cs
- BrushConverter.cs
- UserControl.cs
- StringDictionaryEditor.cs
- InkCanvas.cs
- FontCacheUtil.cs
- PrivateFontCollection.cs
- DataTrigger.cs
- Grammar.cs
- DataObjectCopyingEventArgs.cs
- FlagPanel.cs
- WebServiceErrorEvent.cs
- TableCellCollection.cs
- HostingEnvironment.cs
- ping.cs
- ClassDataContract.cs
- IdentitySection.cs
- HandlerBase.cs
- LoadRetryStrategyFactory.cs
- AssemblyBuilder.cs
- DtcInterfaces.cs
- Double.cs
- FigureHelper.cs
- BitmapEffect.cs
- CharacterShapingProperties.cs
- RootBrowserWindowAutomationPeer.cs
- CreateRefExpr.cs
- ContractMethodInfo.cs
- Style.cs
- IdentityValidationException.cs
- InvalidFilterCriteriaException.cs
- SqlUDTStorage.cs
- SQLInt32Storage.cs
- Annotation.cs
- TextEditorParagraphs.cs
- NullableDoubleAverageAggregationOperator.cs
- TreeNodeClickEventArgs.cs
- _DisconnectOverlappedAsyncResult.cs