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
- ProfilePropertySettingsCollection.cs
- SapiRecognizer.cs
- PriorityBinding.cs
- XmlSchemaSimpleContentExtension.cs
- FontWeightConverter.cs
- EdmComplexTypeAttribute.cs
- PagesChangedEventArgs.cs
- EdgeProfileValidation.cs
- ConfigurationManagerHelper.cs
- ApplyHostConfigurationBehavior.cs
- ObjectStateEntry.cs
- AQNBuilder.cs
- MetaModel.cs
- AssemblyInfo.cs
- XmlSerializerSection.cs
- ElementNotAvailableException.cs
- ToolTipService.cs
- ArcSegment.cs
- JsonQueryStringConverter.cs
- baseaxisquery.cs
- DragEventArgs.cs
- GridViewHeaderRowPresenter.cs
- CorePropertiesFilter.cs
- OdbcConnectionHandle.cs
- SwitchLevelAttribute.cs
- Size.cs
- DependencyPropertyChangedEventArgs.cs
- AnimationClockResource.cs
- OleDbParameterCollection.cs
- SqlMetaData.cs
- RenderingEventArgs.cs
- SqlBooleanizer.cs
- DataTrigger.cs
- CodeSubDirectory.cs
- DynamicPropertyReader.cs
- DataGridParentRows.cs
- MatrixStack.cs
- DesignerAttribute.cs
- Select.cs
- XmlSchemaAttributeGroupRef.cs
- TypeGeneratedEventArgs.cs
- SizeFConverter.cs
- X509SubjectKeyIdentifierClause.cs
- CodeTypeParameterCollection.cs
- ValidatorCompatibilityHelper.cs
- DesignConnection.cs
- ByteStreamGeometryContext.cs
- MetadataFile.cs
- ConfigurationStrings.cs
- RowBinding.cs
- DictionaryCustomTypeDescriptor.cs
- DtdParser.cs
- XmlSignatureManifest.cs
- DecimalAnimationUsingKeyFrames.cs
- FormsAuthenticationCredentials.cs
- SwitchLevelAttribute.cs
- RelatedView.cs
- RegexCapture.cs
- StylusPointPropertyInfo.cs
- MatrixValueSerializer.cs
- DoubleAnimationBase.cs
- GeometryConverter.cs
- UIElementParaClient.cs
- LinqDataSourceHelper.cs
- AspProxy.cs
- CustomTrackingQuery.cs
- TypeDelegator.cs
- AdCreatedEventArgs.cs
- RulePatternOps.cs
- Vector3DValueSerializer.cs
- rsa.cs
- FlowLayoutSettings.cs
- SaveFileDialog.cs
- UTF32Encoding.cs
- OneOfConst.cs
- AnimatedTypeHelpers.cs
- TransferRequestHandler.cs
- ButtonBaseAdapter.cs
- NonVisualControlAttribute.cs
- SystemMulticastIPAddressInformation.cs
- ProcessThreadCollection.cs
- CellCreator.cs
- MemberInfoSerializationHolder.cs
- EmptyReadOnlyDictionaryInternal.cs
- TdsValueSetter.cs
- SqlProviderServices.cs
- GridViewCancelEditEventArgs.cs
- ImmutableObjectAttribute.cs
- FlowPosition.cs
- WebRequestModuleElement.cs
- TypedTableBase.cs
- ObjectTag.cs
- ListControlBoundActionList.cs
- TextBoxRenderer.cs
- XmlSchemaChoice.cs
- TextTreeExtractElementUndoUnit.cs
- SectionXmlInfo.cs
- NativeMethods.cs
- XmlAnyAttributeAttribute.cs
- ColorBuilder.cs