Code:
/ DotNET / DotNET / 8.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
- ResourceReferenceKeyNotFoundException.cs
- UInt64Converter.cs
- StaticContext.cs
- XPathChildIterator.cs
- SchemaAttDef.cs
- CheckBoxDesigner.cs
- CancellationHandler.cs
- Cursors.cs
- AuthorizationSection.cs
- MatrixTransform.cs
- UpDownEvent.cs
- RegexCharClass.cs
- SrgsItemList.cs
- BuildProviderAppliesToAttribute.cs
- OdbcErrorCollection.cs
- FormViewCommandEventArgs.cs
- HttpListenerContext.cs
- CardSpacePolicyElement.cs
- _AutoWebProxyScriptHelper.cs
- TextAutomationPeer.cs
- HttpValueCollection.cs
- StrokeNodeEnumerator.cs
- FrameworkContentElementAutomationPeer.cs
- WindowsSysHeader.cs
- ReadOnlyDataSourceView.cs
- DataPointer.cs
- ExeConfigurationFileMap.cs
- Action.cs
- SystemInformation.cs
- ItemsPresenter.cs
- LineServicesCallbacks.cs
- WMIInterop.cs
- ApplicationContext.cs
- IncomingWebResponseContext.cs
- HtmlCalendarAdapter.cs
- RangeContentEnumerator.cs
- ColumnTypeConverter.cs
- Internal.cs
- Connection.cs
- PatternMatcher.cs
- HttpDictionary.cs
- InternalDuplexChannelFactory.cs
- DesignerLinkAdapter.cs
- XmlDocumentType.cs
- AsymmetricSignatureDeformatter.cs
- InheritanceUI.cs
- ForeignConstraint.cs
- AdapterSwitches.cs
- Schema.cs
- PrivilegedConfigurationManager.cs
- StateWorkerRequest.cs
- RuleProcessor.cs
- StateFinalizationActivity.cs
- Switch.cs
- FragmentNavigationEventArgs.cs
- DetailsViewDeletedEventArgs.cs
- SmiMetaDataProperty.cs
- ThreadStaticAttribute.cs
- TextOnlyOutput.cs
- SaveFileDialog.cs
- mongolianshape.cs
- FormViewInsertEventArgs.cs
- TraceSection.cs
- RemotingSurrogateSelector.cs
- MatchingStyle.cs
- DockAndAnchorLayout.cs
- ParserOptions.cs
- TextEditorTyping.cs
- CfgSemanticTag.cs
- DiagnosticStrings.cs
- AssemblyFilter.cs
- Cursors.cs
- WindowsUserNameCachingSecurityTokenAuthenticator.cs
- ZipIOExtraField.cs
- InstancePersistenceEvent.cs
- Pair.cs
- PersianCalendar.cs
- GregorianCalendar.cs
- HighContrastHelper.cs
- CapiHashAlgorithm.cs
- DomNameTable.cs
- EncodingInfo.cs
- XmlAttributeProperties.cs
- TypeConstant.cs
- WebPartConnectionsConfigureVerb.cs
- HistoryEventArgs.cs
- FixedMaxHeap.cs
- ClassData.cs
- EdmItemCollection.cs
- TraceUtils.cs
- Token.cs
- ServiceBuildProvider.cs
- TraceSource.cs
- SqlMethodCallConverter.cs
- IpcClientChannel.cs
- CommandBinding.cs
- ConditionalWeakTable.cs
- ApplicationCommands.cs
- HyperLinkColumn.cs
- Cursors.cs