Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System { using System; using System.Runtime.Serialization; using System.Globalization; using System.Security.Permissions; ///Gets the text for the message for this exception. ////// [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)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.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
- Mappings.cs
- EncoderParameter.cs
- StubHelpers.cs
- ProfileSettingsCollection.cs
- COM2TypeInfoProcessor.cs
- BaseComponentEditor.cs
- HtmlImageAdapter.cs
- Publisher.cs
- WebContext.cs
- HttpProfileGroupBase.cs
- EventLogStatus.cs
- DrawListViewSubItemEventArgs.cs
- Header.cs
- _Semaphore.cs
- FilterException.cs
- ValidationEventArgs.cs
- SystemIcmpV6Statistics.cs
- WebConfigurationFileMap.cs
- ProfilePropertyMetadata.cs
- brushes.cs
- ContentAlignmentEditor.cs
- SmiEventSink.cs
- ConfigurationLocationCollection.cs
- FullTextState.cs
- EdmConstants.cs
- RotationValidation.cs
- HttpCookieCollection.cs
- Deflater.cs
- ExpressionParser.cs
- WebPartManager.cs
- MessagePartProtectionMode.cs
- PartialClassGenerationTaskInternal.cs
- EventPropertyMap.cs
- PropertyRef.cs
- RelatedView.cs
- ScriptingJsonSerializationSection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- MenuRenderer.cs
- ECDiffieHellmanPublicKey.cs
- SqlGatherConsumedAliases.cs
- ChameleonKey.cs
- RequestBringIntoViewEventArgs.cs
- UmAlQuraCalendar.cs
- ChannelCredentials.cs
- WaitHandleCannotBeOpenedException.cs
- LineGeometry.cs
- SecurityTokenTypes.cs
- XmlSchemaInclude.cs
- XsltException.cs
- QueueProcessor.cs
- CodeExpressionStatement.cs
- AddInAdapter.cs
- MruCache.cs
- OAVariantLib.cs
- GeneratedView.cs
- TraversalRequest.cs
- TraceHandler.cs
- SspiSafeHandles.cs
- VersionedStreamOwner.cs
- FlowchartSizeFeature.cs
- RecordManager.cs
- SafeCryptoHandles.cs
- HttpHandlersSection.cs
- GlobalizationAssembly.cs
- ImageField.cs
- FormsAuthenticationCredentials.cs
- System.Data.OracleClient_BID.cs
- IndexedGlyphRun.cs
- PenThread.cs
- BamlCollectionHolder.cs
- PackageStore.cs
- OdbcCommand.cs
- DrawingImage.cs
- CheckBoxField.cs
- WindowsIdentity.cs
- SubpageParaClient.cs
- Random.cs
- StringReader.cs
- TypedElement.cs
- SaveFileDialog.cs
- LayoutEditorPart.cs
- PathFigureCollection.cs
- HostingPreferredMapPath.cs
- AssociationSetMetadata.cs
- WhitespaceRuleReader.cs
- SqlInternalConnection.cs
- Model3DGroup.cs
- AsyncContentLoadedEventArgs.cs
- IOThreadScheduler.cs
- InternalCache.cs
- ConfigurationElementProperty.cs
- MailHeaderInfo.cs
- HttpRuntimeSection.cs
- ValidatorCollection.cs
- ButtonBaseAdapter.cs
- _ConnectOverlappedAsyncResult.cs
- XmlSchemaValidator.cs
- XmlILTrace.cs
- DirectionalLight.cs
- TimestampInformation.cs