Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / ObjectDisposedException.cs / 1 / ObjectDisposedException.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System { using System; using System.Runtime.Serialization; using System.Globalization; using System.Security.Permissions; ////// [System.Runtime.InteropServices.ComVisible(true)] [Serializable()]public class ObjectDisposedException : InvalidOperationException { private String objectName; // This constructor should only be called by the EE (COMPlusThrow) private ObjectDisposedException() : this(null ,Environment.GetResourceString("ObjectDisposed_Generic")) { } public ObjectDisposedException(String objectName) : this(objectName, Environment.GetResourceString("ObjectDisposed_Generic")) { } public ObjectDisposedException(String objectName, String message) : base(message) { SetErrorCode(__HResults.COR_E_OBJECTDISPOSED); this.objectName = objectName; } public ObjectDisposedException(String message, Exception innerException) : base(message, innerException) { SetErrorCode(__HResults.COR_E_OBJECTDISPOSED); } ///The exception that is thrown when accessing an object that was /// disposed. ////// public override String Message { get { String name = ObjectName; if (name == null || name.Length == 0) return base.Message; return base.Message + Environment.NewLine + String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ObjectDisposed_ObjectName_Name"), name); } } public String ObjectName { get { if (objectName == null) return String.Empty; return objectName; } } protected ObjectDisposedException(SerializationInfo info, StreamingContext context) : base(info, context) { objectName = info.GetString("ObjectName"); } [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue("ObjectName",ObjectName,typeof(String)); } } }Gets the text for the message for this exception. ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ForEach.cs
- ControlPersister.cs
- ChannelSinkStacks.cs
- UriTemplatePathSegment.cs
- VersionValidator.cs
- HttpCapabilitiesEvaluator.cs
- DocumentGrid.cs
- MessageSmuggler.cs
- HelpHtmlBuilder.cs
- SamlAssertionKeyIdentifierClause.cs
- __Filters.cs
- ResourceKey.cs
- RefreshEventArgs.cs
- QueryOutputWriterV1.cs
- AutoResetEvent.cs
- NotImplementedException.cs
- OdbcEnvironmentHandle.cs
- ListViewInsertionMark.cs
- Int32Collection.cs
- ToolTipService.cs
- GridViewHeaderRowPresenter.cs
- FamilyMap.cs
- _SslState.cs
- ContainerControl.cs
- WeakEventTable.cs
- DynamicValidatorEventArgs.cs
- SqlConnectionString.cs
- Cursors.cs
- AsyncResult.cs
- Grammar.cs
- AlternateView.cs
- ThicknessAnimation.cs
- RawStylusActions.cs
- PriorityItem.cs
- CombinedGeometry.cs
- SimpleHandlerBuildProvider.cs
- TextServicesDisplayAttributePropertyRanges.cs
- SHA1Managed.cs
- DtcInterfaces.cs
- TypeForwardedToAttribute.cs
- WebPart.cs
- ItemList.cs
- ApplicationBuildProvider.cs
- UriPrefixTable.cs
- SectionInput.cs
- OpCellTreeNode.cs
- DataBindingExpressionBuilder.cs
- QueryOutputWriter.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- documentsequencetextview.cs
- FreezableDefaultValueFactory.cs
- DrawingAttributesDefaultValueFactory.cs
- XmlMapping.cs
- DataGridItemEventArgs.cs
- TerminatorSinks.cs
- FixedFindEngine.cs
- PropertyConverter.cs
- ListBoxItemWrapperAutomationPeer.cs
- SelectionListDesigner.cs
- LocationUpdates.cs
- CodeVariableDeclarationStatement.cs
- PieceDirectory.cs
- BrushValueSerializer.cs
- EmptyControlCollection.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ScriptReference.cs
- InternalBase.cs
- IRCollection.cs
- DataTableReaderListener.cs
- CategoryGridEntry.cs
- CuspData.cs
- TransportBindingElement.cs
- XmlWellformedWriter.cs
- DataGridViewBand.cs
- LoginName.cs
- SocketElement.cs
- DataGridViewSelectedRowCollection.cs
- CodeNamespaceImportCollection.cs
- WebServiceClientProxyGenerator.cs
- ArraySegment.cs
- ServiceModelConfiguration.cs
- XslAst.cs
- AvtEvent.cs
- Slider.cs
- ObjectListComponentEditor.cs
- ReflectionTypeLoadException.cs
- PrintingPermission.cs
- ImageSourceConverter.cs
- AsyncOperation.cs
- Compensate.cs
- WebPartExportVerb.cs
- SortedSet.cs
- BatchParser.cs
- XmlMtomReader.cs
- PanelDesigner.cs
- ListComponentEditorPage.cs
- OSEnvironmentHelper.cs
- Point4D.cs
- UndoUnit.cs
- NonSerializedAttribute.cs