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
- StringReader.cs
- DocumentSchemaValidator.cs
- Stroke2.cs
- GraphicsPath.cs
- SqlDataSourceEnumerator.cs
- shaperfactory.cs
- Pair.cs
- SafeRightsManagementHandle.cs
- DataGridTextBoxColumn.cs
- GridViewDesigner.cs
- OpenFileDialog.cs
- ImageSource.cs
- PartitionedDataSource.cs
- PeerTransportElement.cs
- Line.cs
- UmAlQuraCalendar.cs
- CompiledQueryCacheKey.cs
- DataBindingExpressionBuilder.cs
- HashLookup.cs
- EventMemberCodeDomSerializer.cs
- DoWorkEventArgs.cs
- Win32.cs
- ArgumentOutOfRangeException.cs
- XmlSchemaComplexContentRestriction.cs
- securestring.cs
- RichTextBoxConstants.cs
- AssemblyBuilderData.cs
- DomNameTable.cs
- SimpleWebHandlerParser.cs
- ChameleonKey.cs
- DocumentApplication.cs
- BaseCollection.cs
- DesignerOptions.cs
- Solver.cs
- ListItemCollection.cs
- TextEditorDragDrop.cs
- StringCollection.cs
- InternalConfigConfigurationFactory.cs
- DataSourceControlBuilder.cs
- ListViewItem.cs
- EventDrivenDesigner.cs
- CompilerState.cs
- Geometry.cs
- RadioButtonList.cs
- SHA384Managed.cs
- MaskDescriptor.cs
- ZoneLinkButton.cs
- StylusSystemGestureEventArgs.cs
- UnsafeNativeMethods.cs
- CannotUnloadAppDomainException.cs
- SourceFileBuildProvider.cs
- HMACSHA512.cs
- TransportContext.cs
- HtmlGenericControl.cs
- Int16Storage.cs
- DynamicValueConverter.cs
- DesignerCapabilities.cs
- Rect3DValueSerializer.cs
- QueryOutputWriter.cs
- CompilationUtil.cs
- ControlParameter.cs
- GiveFeedbackEvent.cs
- DivideByZeroException.cs
- ValidatorCompatibilityHelper.cs
- ReplacementText.cs
- Cursor.cs
- Semaphore.cs
- XmlAttributeOverrides.cs
- UntypedNullExpression.cs
- PathSegmentCollection.cs
- ResourceIDHelper.cs
- NamedPipeTransportManager.cs
- DataControlFieldCollection.cs
- IsolatedStorageFile.cs
- ByteStream.cs
- ParseNumbers.cs
- WebPartConnectionsCancelEventArgs.cs
- WorkflowNamespace.cs
- TemplateField.cs
- SqlUtils.cs
- XD.cs
- SimpleType.cs
- ScriptControl.cs
- NotificationContext.cs
- SourceFileBuildProvider.cs
- TableCellAutomationPeer.cs
- XmlSerializationReader.cs
- DataGridViewRowEventArgs.cs
- MissingManifestResourceException.cs
- AbstractSvcMapFileLoader.cs
- JsonFaultDetail.cs
- XmlSignatureProperties.cs
- TypeDescriptionProvider.cs
- DataObjectMethodAttribute.cs
- StaticExtension.cs
- IIS7WorkerRequest.cs
- Effect.cs
- WpfKnownMemberInvoker.cs
- PeerNameRegistration.cs
- FunctionOverloadResolver.cs