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
- PrintingPermissionAttribute.cs
- ToolStripItemTextRenderEventArgs.cs
- ProfilePropertyNameValidator.cs
- XmlSerializationReader.cs
- ellipse.cs
- _TransmitFileOverlappedAsyncResult.cs
- XpsFilter.cs
- InternalPermissions.cs
- GridViewRow.cs
- DesignTimeTemplateParser.cs
- DispatcherFrame.cs
- StreamWriter.cs
- DeviceFilterDictionary.cs
- DetailsViewDeletedEventArgs.cs
- SqlUdtInfo.cs
- SecurityTokenParameters.cs
- LookupBindingPropertiesAttribute.cs
- ApplicationProxyInternal.cs
- RequestNavigateEventArgs.cs
- MimeTypeMapper.cs
- CompilerResults.cs
- MultipleViewProviderWrapper.cs
- AddInIpcChannel.cs
- PageFunction.cs
- SetterBaseCollection.cs
- MetadataItemEmitter.cs
- ChameleonKey.cs
- CheckBoxField.cs
- DebugController.cs
- RestHandlerFactory.cs
- ListDictionaryInternal.cs
- Run.cs
- SQLGuidStorage.cs
- BoundsDrawingContextWalker.cs
- wmiutil.cs
- WorkflowServiceHostFactory.cs
- CollectionType.cs
- _BasicClient.cs
- TreeNodeMouseHoverEvent.cs
- CLSCompliantAttribute.cs
- CodeMethodReturnStatement.cs
- PiiTraceSource.cs
- ContainerUtilities.cs
- NativeRecognizer.cs
- ErrorEventArgs.cs
- FixedTextView.cs
- ObjectDataSourceWizardForm.cs
- Inflater.cs
- Margins.cs
- FlowLayout.cs
- FontFamilyConverter.cs
- PeerApplication.cs
- EntityWrapper.cs
- BamlBinaryWriter.cs
- DataGridTable.cs
- unitconverter.cs
- BitmapScalingModeValidation.cs
- GridViewDesigner.cs
- ObjectQuery.cs
- CatalogZoneBase.cs
- FixedBufferAttribute.cs
- ExecutionPropertyManager.cs
- MimePart.cs
- StylusPlugin.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- TraceUtils.cs
- QueryAccessibilityHelpEvent.cs
- CqlParserHelpers.cs
- XmlSerializerFaultFormatter.cs
- And.cs
- Exception.cs
- InternalControlCollection.cs
- TrackingDataItem.cs
- ProfileGroupSettingsCollection.cs
- FormViewPageEventArgs.cs
- DataGridViewCheckBoxCell.cs
- NativeWindow.cs
- InputLangChangeRequestEvent.cs
- VisualProxy.cs
- CodeAssignStatement.cs
- XmlSchemaSimpleType.cs
- XmlILOptimizerVisitor.cs
- RSAOAEPKeyExchangeFormatter.cs
- AggregationMinMaxHelpers.cs
- TextOnlyOutput.cs
- SettingsPropertyIsReadOnlyException.cs
- EndpointDiscoveryBehavior.cs
- NativeRightsManagementAPIsStructures.cs
- GlyphCache.cs
- DriveInfo.cs
- PointConverter.cs
- OptimizedTemplateContent.cs
- FigureParaClient.cs
- ValidationErrorEventArgs.cs
- ButtonBaseAutomationPeer.cs
- Italic.cs
- Attribute.cs
- DataBinder.cs
- SetStoryboardSpeedRatio.cs
- XmlSchemaAttributeGroup.cs