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
- URLString.cs
- ManagedFilter.cs
- XPathConvert.cs
- ConfigurationStrings.cs
- NonVisualControlAttribute.cs
- KeyPullup.cs
- EdmFunction.cs
- BufferedGraphicsContext.cs
- HiddenField.cs
- CaretElement.cs
- MiniAssembly.cs
- HttpHandlerActionCollection.cs
- ResourceReferenceExpressionConverter.cs
- ErrorHandler.cs
- UIPermission.cs
- XmlSerializer.cs
- DataGridAutoFormat.cs
- ListItemsCollectionEditor.cs
- AccessKeyManager.cs
- HTTPNotFoundHandler.cs
- Int16Converter.cs
- AssociationTypeEmitter.cs
- TdsParserSessionPool.cs
- CreatingCookieEventArgs.cs
- CharConverter.cs
- HelloMessageCD1.cs
- ListChangedEventArgs.cs
- ExplicitDiscriminatorMap.cs
- ResourceWriter.cs
- StylusLogic.cs
- _BaseOverlappedAsyncResult.cs
- exports.cs
- SimpleWorkerRequest.cs
- LicenseContext.cs
- ValidationEventArgs.cs
- SplitterCancelEvent.cs
- IImplicitResourceProvider.cs
- indexingfiltermarshaler.cs
- BlurEffect.cs
- DocumentGridContextMenu.cs
- ListItemConverter.cs
- ArrayWithOffset.cs
- RequestResizeEvent.cs
- DesignerAutoFormat.cs
- EntityCommand.cs
- FrameworkElement.cs
- AsyncInvokeContext.cs
- PanelContainerDesigner.cs
- DispatchOperation.cs
- DataKeyArray.cs
- ContainerAction.cs
- XmlSchemaElement.cs
- StylusTip.cs
- DeferredElementTreeState.cs
- DynamicRenderer.cs
- CalendarDataBindingHandler.cs
- StrokeNode.cs
- SettingsPropertyCollection.cs
- precedingquery.cs
- KeyedCollection.cs
- ApplicationDirectoryMembershipCondition.cs
- DataGridViewCellConverter.cs
- ContentOperations.cs
- RawKeyboardInputReport.cs
- NumberFormatInfo.cs
- PublisherIdentityPermission.cs
- UnauthorizedWebPart.cs
- BaseUriHelper.cs
- IndexerHelper.cs
- Function.cs
- TextAdaptor.cs
- WebServiceBindingAttribute.cs
- BinaryObjectReader.cs
- SqlBooleanMismatchVisitor.cs
- ModifyActivitiesPropertyDescriptor.cs
- SyndicationSerializer.cs
- LocalBuilder.cs
- ToolBarButton.cs
- HttpsChannelListener.cs
- WorkflowInstanceExtensionManager.cs
- SafeMarshalContext.cs
- TraceContextEventArgs.cs
- InkCanvas.cs
- OdbcConnection.cs
- HostingPreferredMapPath.cs
- MetadataArtifactLoaderCompositeFile.cs
- ReceiveSecurityHeaderEntry.cs
- MarkupProperty.cs
- SingleAnimationUsingKeyFrames.cs
- TextTreeRootTextBlock.cs
- DefinitionUpdate.cs
- Command.cs
- ReturnType.cs
- ObjRef.cs
- Stack.cs
- LineGeometry.cs
- WithParamAction.cs
- DBAsyncResult.cs
- CryptoApi.cs
- PrintPreviewDialog.cs