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
- DateTimeFormat.cs
- CngProperty.cs
- Monitor.cs
- DispatcherExceptionEventArgs.cs
- Matrix3D.cs
- UpdateCommand.cs
- NativeMethods.cs
- ScriptingScriptResourceHandlerSection.cs
- StructuralType.cs
- TdsParser.cs
- AuthorizationRule.cs
- BindToObject.cs
- Int32EqualityComparer.cs
- MiniLockedBorderGlyph.cs
- ClipboardProcessor.cs
- ReferenceEqualityComparer.cs
- Descriptor.cs
- WebPartUtil.cs
- BasicCommandTreeVisitor.cs
- DataGridRow.cs
- VectorKeyFrameCollection.cs
- DataGridViewCellCollection.cs
- SystemThemeKey.cs
- DecimalConstantAttribute.cs
- PaintValueEventArgs.cs
- DataGridViewToolTip.cs
- FormsAuthenticationEventArgs.cs
- SqlMethodTransformer.cs
- FindResponse.cs
- XPathDocumentBuilder.cs
- ByteStack.cs
- ParserContext.cs
- MergeLocalizationDirectives.cs
- DrawListViewSubItemEventArgs.cs
- MonthCalendar.cs
- SHA1Managed.cs
- RuntimeArgumentHandle.cs
- EmptyEnumerator.cs
- TouchEventArgs.cs
- FixedHighlight.cs
- Membership.cs
- ResXResourceReader.cs
- XmlSchemaImport.cs
- TemplateColumn.cs
- ScrollBar.cs
- DateTimeFormatInfo.cs
- CngKeyCreationParameters.cs
- InternalConfirm.cs
- SafeNativeMethods.cs
- RectangleF.cs
- SchemaExporter.cs
- PublisherIdentityPermission.cs
- Image.cs
- BitmapEffectGroup.cs
- FastEncoder.cs
- PingOptions.cs
- FilterException.cs
- DataGridViewCellMouseEventArgs.cs
- Win32Exception.cs
- StringInfo.cs
- InvokeMethodActivity.cs
- smtpconnection.cs
- LayoutManager.cs
- HttpHandlersInstallComponent.cs
- SymbolEqualComparer.cs
- MatrixTransform3D.cs
- sqlcontext.cs
- NativeActivityMetadata.cs
- MasterPageCodeDomTreeGenerator.cs
- ChangeProcessor.cs
- SafeViewOfFileHandle.cs
- HttpAsyncResult.cs
- TraceLevelStore.cs
- SpecularMaterial.cs
- XmlSchemaSimpleContentRestriction.cs
- XmlMtomReader.cs
- MbpInfo.cs
- SystemIPInterfaceStatistics.cs
- SHA384Cng.cs
- AddressAlreadyInUseException.cs
- LogManagementAsyncResult.cs
- TextCompositionManager.cs
- ConfigPathUtility.cs
- RecordsAffectedEventArgs.cs
- EventData.cs
- RichTextBox.cs
- BufferedGraphicsContext.cs
- CompilationRelaxations.cs
- RadioButtonList.cs
- VariableElement.cs
- SimpleTypeResolver.cs
- DbLambda.cs
- QilSortKey.cs
- ChannelBinding.cs
- AuthenticationService.cs
- CodeDelegateInvokeExpression.cs
- InternalConfigConfigurationFactory.cs
- OperationResponse.cs
- ColorTypeConverter.cs
- LinqDataSourceContextData.cs