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
- RemotingClientProxy.cs
- QueryOperationResponseOfT.cs
- MutexSecurity.cs
- DataServiceResponse.cs
- SuppressMessageAttribute.cs
- EntityModelBuildProvider.cs
- ApplicationInterop.cs
- _HeaderInfo.cs
- PropertyDescriptorCollection.cs
- StrongNameKeyPair.cs
- SoapConverter.cs
- OutKeywords.cs
- StyleModeStack.cs
- GridViewCellAutomationPeer.cs
- RecognitionResult.cs
- StaticSiteMapProvider.cs
- DataControlCommands.cs
- TracedNativeMethods.cs
- XPathScanner.cs
- DataGridViewCellFormattingEventArgs.cs
- Nodes.cs
- FixedBufferAttribute.cs
- HtmlMeta.cs
- XamlSerializationHelper.cs
- Effect.cs
- ValueTypeFixupInfo.cs
- BamlTreeMap.cs
- ChtmlFormAdapter.cs
- TextBlockAutomationPeer.cs
- ContentTextAutomationPeer.cs
- SmtpNtlmAuthenticationModule.cs
- BindingMemberInfo.cs
- Brushes.cs
- ViewStateModeByIdAttribute.cs
- IgnoreFileBuildProvider.cs
- ObjectDataSourceMethodEditor.cs
- LayoutExceptionEventArgs.cs
- CodeComment.cs
- XmlSchemaComplexContentRestriction.cs
- KeyValueConfigurationCollection.cs
- PointAnimation.cs
- DynamicILGenerator.cs
- DrawingServices.cs
- WebUtil.cs
- FontEmbeddingManager.cs
- HebrewNumber.cs
- ItemCollectionEditor.cs
- AnimationTimeline.cs
- EntryIndex.cs
- FullTrustAssembliesSection.cs
- WebPartEditorOkVerb.cs
- SqlConnectionPoolProviderInfo.cs
- TreeNode.cs
- ByteStream.cs
- GenericTypeParameterBuilder.cs
- CodeTypeDeclarationCollection.cs
- ApplicationId.cs
- DependencyObjectType.cs
- XamlTreeBuilder.cs
- DecoderBestFitFallback.cs
- LocalizationComments.cs
- ListViewSelectEventArgs.cs
- HostSecurityManager.cs
- CustomCredentialPolicy.cs
- XmlSerializableServices.cs
- DeclaredTypeElementCollection.cs
- RealizedColumnsBlock.cs
- RegexInterpreter.cs
- BlockCollection.cs
- RepeatInfo.cs
- ConfigXmlWhitespace.cs
- DBDataPermissionAttribute.cs
- ChangeNode.cs
- ColumnPropertiesGroup.cs
- InstancePersistence.cs
- EditorResources.cs
- NamedElement.cs
- XPathNavigator.cs
- StackSpiller.cs
- SoapMessage.cs
- DbMetaDataFactory.cs
- CustomWebEventKey.cs
- String.cs
- ToolboxBitmapAttribute.cs
- CacheSection.cs
- XNodeNavigator.cs
- GorillaCodec.cs
- SymbolUsageManager.cs
- FieldMetadata.cs
- TdsParserStateObject.cs
- NavigationHelper.cs
- TreeView.cs
- BuildManagerHost.cs
- SkinBuilder.cs
- AuthenticationModuleElement.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- TypeSystem.cs
- ParameterElementCollection.cs
- counter.cs
- ScrollChrome.cs