Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / ObjectDisposedException.cs / 1305376 / 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 { [System.Security.SecuritySafeCritical] // auto-generated get { String name = ObjectName; if (name == null || name.Length == 0) return base.Message; String objectDisposed = Environment.GetResourceString("ObjectDisposed_ObjectName_Name", name); return base.Message + Environment.NewLine + objectDisposed; } } public String ObjectName { get { if (objectName == null) return String.Empty; return objectName; } } [System.Security.SecuritySafeCritical] // auto-generated protected ObjectDisposedException(SerializationInfo info, StreamingContext context) : base(info, context) { objectName = info.GetString("ObjectName"); } [System.Security.SecurityCritical] // auto-generated_required 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 { [System.Security.SecuritySafeCritical] // auto-generated get { String name = ObjectName; if (name == null || name.Length == 0) return base.Message; String objectDisposed = Environment.GetResourceString("ObjectDisposed_ObjectName_Name", name); return base.Message + Environment.NewLine + objectDisposed; } } public String ObjectName { get { if (objectName == null) return String.Empty; return objectName; } } [System.Security.SecuritySafeCritical] // auto-generated protected ObjectDisposedException(SerializationInfo info, StreamingContext context) : base(info, context) { objectName = info.GetString("ObjectName"); } [System.Security.SecurityCritical] // auto-generated_required 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
- DirectionalLight.cs
- UnsafeNativeMethods.cs
- DeploymentSectionCache.cs
- TableItemStyle.cs
- CryptographicAttribute.cs
- ToolStripLocationCancelEventArgs.cs
- securitycriticaldata.cs
- HttpWebRequestElement.cs
- XmlDomTextWriter.cs
- _StreamFramer.cs
- MulticastIPAddressInformationCollection.cs
- _ListenerAsyncResult.cs
- ThreadStateException.cs
- HttpListenerException.cs
- SqlParameterizer.cs
- LinkedResourceCollection.cs
- ToolStripPanelRow.cs
- WsatConfiguration.cs
- WmiEventSink.cs
- DataTablePropertyDescriptor.cs
- HtmlToClrEventProxy.cs
- SqlMethodAttribute.cs
- File.cs
- isolationinterop.cs
- ScrollItemPattern.cs
- MenuItemStyleCollection.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- FrameworkRichTextComposition.cs
- ExpressionNode.cs
- StringExpressionSet.cs
- StatusBarDrawItemEvent.cs
- WebPartsPersonalizationAuthorization.cs
- SQLConvert.cs
- FixedDocumentSequencePaginator.cs
- ArithmeticException.cs
- ScrollChrome.cs
- FolderBrowserDialog.cs
- GenericEnumConverter.cs
- MembershipSection.cs
- OutputCacheSettingsSection.cs
- XmlUtil.cs
- PrivateFontCollection.cs
- Font.cs
- ListSortDescriptionCollection.cs
- ControlUtil.cs
- OdbcConnectionPoolProviderInfo.cs
- XsltQilFactory.cs
- XPathNode.cs
- GPPOINT.cs
- ChannelServices.cs
- WeakReference.cs
- CodeSubDirectory.cs
- ProtectedConfiguration.cs
- DataSourceHelper.cs
- Method.cs
- DesignTimeVisibleAttribute.cs
- COSERVERINFO.cs
- FileSecurity.cs
- Annotation.cs
- OperandQuery.cs
- _NestedSingleAsyncResult.cs
- SortedDictionary.cs
- SessionConnectionReader.cs
- ImmComposition.cs
- MenuCommands.cs
- ItemCollection.cs
- KnownTypeAttribute.cs
- SafeArrayTypeMismatchException.cs
- ImageClickEventArgs.cs
- DataTableTypeConverter.cs
- HtmlImage.cs
- CrossSiteScriptingValidation.cs
- ExpandSegment.cs
- PersistChildrenAttribute.cs
- QilReplaceVisitor.cs
- CapabilitiesUse.cs
- Assembly.cs
- CapabilitiesPattern.cs
- TextProperties.cs
- TextContainerChangeEventArgs.cs
- hwndwrapper.cs
- TypeDescriptionProvider.cs
- RealizationDrawingContextWalker.cs
- RequestContext.cs
- CloudCollection.cs
- Vector3DKeyFrameCollection.cs
- BehaviorEditorPart.cs
- HttpHandlersSection.cs
- XmlSignificantWhitespace.cs
- TextModifierScope.cs
- While.cs
- InstanceLockedException.cs
- PolyLineSegment.cs
- StylusOverProperty.cs
- FormatterServices.cs
- ContextProperty.cs
- WindowShowOrOpenTracker.cs
- VisualBasicValue.cs
- AttributeSetAction.cs
- DocumentSequenceHighlightLayer.cs