Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- RegularExpressionValidator.cs
- FieldInfo.cs
- TypeConvertions.cs
- xsdvalidator.cs
- Trace.cs
- FormDocumentDesigner.cs
- LinearGradientBrush.cs
- DictionaryEntry.cs
- HitTestDrawingContextWalker.cs
- CngKey.cs
- WhitespaceReader.cs
- TextMessageEncoder.cs
- SessionIDManager.cs
- AuthenticationModuleElement.cs
- DocobjHost.cs
- SettingsProviderCollection.cs
- WebServiceData.cs
- TextFormatter.cs
- DataSourceComponent.cs
- WindowPattern.cs
- ImageSourceConverter.cs
- WindowsSecurityTokenAuthenticator.cs
- WebPartAddingEventArgs.cs
- ErrorFormatter.cs
- RootNamespaceAttribute.cs
- AggregateException.cs
- HttpException.cs
- ExpressionPrinter.cs
- CounterCreationDataCollection.cs
- TrackingLocationCollection.cs
- MatrixAnimationUsingKeyFrames.cs
- DataGridViewColumnCollectionEditor.cs
- DelimitedListTraceListener.cs
- LayoutUtils.cs
- DatatypeImplementation.cs
- HideDisabledControlAdapter.cs
- BlockingCollection.cs
- MediaElementAutomationPeer.cs
- HierarchicalDataTemplate.cs
- RemoteWebConfigurationHostServer.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- SearchForVirtualItemEventArgs.cs
- FastPropertyAccessor.cs
- D3DImage.cs
- StylusButtonCollection.cs
- ResourceSet.cs
- FreeFormDesigner.cs
- RTLAwareMessageBox.cs
- TypeDescriptor.cs
- HttpHandlerActionCollection.cs
- GenericEnumerator.cs
- MenuItemStyleCollection.cs
- TitleStyle.cs
- OleDbCommandBuilder.cs
- SchemaElement.cs
- AssociatedControlConverter.cs
- ActivityExecutorSurrogate.cs
- OdbcEnvironmentHandle.cs
- ListParaClient.cs
- DesignTimeTemplateParser.cs
- Events.cs
- XmlSchemaCollection.cs
- Timer.cs
- EventData.cs
- CacheChildrenQuery.cs
- WebResourceUtil.cs
- XmlBinaryReader.cs
- IncrementalHitTester.cs
- CodeNamespaceImport.cs
- Int64.cs
- SplitterPanel.cs
- DBConnection.cs
- XmlSchemaSimpleContent.cs
- Frame.cs
- DbgUtil.cs
- EditorPartChrome.cs
- LineSegment.cs
- XmlDigitalSignatureProcessor.cs
- TextRunCache.cs
- SqlException.cs
- SamlAuthenticationStatement.cs
- Polyline.cs
- AxHost.cs
- CollectionViewGroupRoot.cs
- MatcherBuilder.cs
- DeleteIndexBinder.cs
- ToolStripDropDownItemDesigner.cs
- FormViewDeleteEventArgs.cs
- OdbcConnectionHandle.cs
- DynamicControlParameter.cs
- RegistryPermission.cs
- WebResponse.cs
- FixUp.cs
- EntityDataSourceContextCreatedEventArgs.cs
- SymbolType.cs
- GiveFeedbackEventArgs.cs
- BaseDataBoundControl.cs
- DefaultValueConverter.cs
- CalendarDay.cs
- CodeSubDirectory.cs