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
- Serializer.cs
- MailMessage.cs
- NonParentingControl.cs
- XmlIlVisitor.cs
- CursorConverter.cs
- MemberInfoSerializationHolder.cs
- XmlEncodedRawTextWriter.cs
- FlowDocument.cs
- CopyOfAction.cs
- SamlDelegatingWriter.cs
- ObjectListGeneralPage.cs
- XmlSerializerFactory.cs
- EditableRegion.cs
- XmlDataSource.cs
- IndentTextWriter.cs
- FullTextBreakpoint.cs
- PageStatePersister.cs
- SHA1Managed.cs
- DocumentCollection.cs
- SchemaDeclBase.cs
- ObjectViewQueryResultData.cs
- InputScopeConverter.cs
- QueryRewriter.cs
- XmlSecureResolver.cs
- ProtocolElementCollection.cs
- Internal.cs
- DropDownList.cs
- IIS7UserPrincipal.cs
- AuthenticationConfig.cs
- ProfileService.cs
- ResourceContainer.cs
- _StreamFramer.cs
- XmlSchemaSet.cs
- FormatterServices.cs
- SafeHandles.cs
- ValidatedControlConverter.cs
- CharUnicodeInfo.cs
- CompoundFileStorageReference.cs
- MonthCalendar.cs
- AttributeUsageAttribute.cs
- BamlResourceContent.cs
- UnsafeNativeMethods.cs
- ParseElementCollection.cs
- Listbox.cs
- FlowDocumentReader.cs
- PathTooLongException.cs
- ConnectionPoint.cs
- OlePropertyStructs.cs
- BufferedReadStream.cs
- QilChoice.cs
- CompiledQueryCacheKey.cs
- hresults.cs
- FixedDocumentSequencePaginator.cs
- OAVariantLib.cs
- PathSegmentCollection.cs
- ExpandedWrapper.cs
- RangeBaseAutomationPeer.cs
- ProcessStartInfo.cs
- ToolTip.cs
- Soap12ProtocolReflector.cs
- QuotedStringFormatReader.cs
- HtmlInputHidden.cs
- TemplatedWizardStep.cs
- ExtentCqlBlock.cs
- ToolTipService.cs
- Tuple.cs
- QuotedPairReader.cs
- AssertFilter.cs
- ImageAutomationPeer.cs
- UrlMapping.cs
- NameObjectCollectionBase.cs
- TreeWalker.cs
- NumericPagerField.cs
- Calendar.cs
- ManagementNamedValueCollection.cs
- DoubleCollection.cs
- ErrorLog.cs
- webbrowsersite.cs
- GroupBox.cs
- ImageField.cs
- OleDbConnectionInternal.cs
- HtmlControl.cs
- UrlMappingsSection.cs
- ConditionalAttribute.cs
- IdentityManager.cs
- Path.cs
- GlobalProxySelection.cs
- PagePropertiesChangingEventArgs.cs
- TransportationConfigurationTypeInstallComponent.cs
- PassportPrincipal.cs
- PingOptions.cs
- _CacheStreams.cs
- WebPartEditorCancelVerb.cs
- Util.cs
- XmlSchemaExternal.cs
- QilInvoke.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- GlyphRunDrawing.cs
- IChannel.cs
- WasAdminWrapper.cs