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
- SqlDataSourceEnumerator.cs
- MethodToken.cs
- DigestTraceRecordHelper.cs
- EngineSiteSapi.cs
- NavigationWindowAutomationPeer.cs
- DesignTable.cs
- Clause.cs
- ObjectParameterCollection.cs
- VScrollProperties.cs
- StrongBox.cs
- DbConnectionPoolIdentity.cs
- httpserverutility.cs
- LineInfo.cs
- SecurityResources.cs
- HostingEnvironmentException.cs
- WizardPanel.cs
- TraceSwitch.cs
- XmlName.cs
- DataGridCaption.cs
- TemplateBuilder.cs
- DataColumnMapping.cs
- RectAnimation.cs
- DynamicMethod.cs
- TreeBuilderBamlTranslator.cs
- RemotingException.cs
- BitArray.cs
- EdmSchemaAttribute.cs
- ToolBarTray.cs
- SoapHeader.cs
- Matrix.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- counter.cs
- SizeAnimation.cs
- VersionUtil.cs
- BitmapVisualManager.cs
- XmlSerializerFactory.cs
- ErrorTableItemStyle.cs
- DBPropSet.cs
- RectAnimationClockResource.cs
- OfTypeExpression.cs
- StylusShape.cs
- ServiceHostFactory.cs
- ObfuscateAssemblyAttribute.cs
- Byte.cs
- TdsEnums.cs
- CodeBinaryOperatorExpression.cs
- VectorAnimation.cs
- PathStreamGeometryContext.cs
- DataControlImageButton.cs
- HtmlTernaryTree.cs
- SimpleWebHandlerParser.cs
- FixedDocumentPaginator.cs
- NativeMethods.cs
- StylusCaptureWithinProperty.cs
- ConfigurationManagerHelperFactory.cs
- DataGridState.cs
- Control.cs
- DocumentApplicationJournalEntry.cs
- FileSystemInfo.cs
- StorageInfo.cs
- DisposableCollectionWrapper.cs
- LabelEditEvent.cs
- BindToObject.cs
- TypeGenericEnumerableViewSchema.cs
- PageBreakRecord.cs
- ResourcesChangeInfo.cs
- CellLabel.cs
- GAC.cs
- WebPartExportVerb.cs
- Bits.cs
- DataGridColumnsPage.cs
- TextUtf8RawTextWriter.cs
- WebBrowserDocumentCompletedEventHandler.cs
- ChildrenQuery.cs
- WebUtil.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- NumericUpDownAcceleration.cs
- Permission.cs
- ServiceOperationParameter.cs
- Types.cs
- DataSysAttribute.cs
- StringSource.cs
- TemplateBindingExtension.cs
- DataPagerFieldItem.cs
- DnsPermission.cs
- PrintDialog.cs
- SQLBoolean.cs
- WebPartEditVerb.cs
- MatrixAnimationBase.cs
- TextRunCache.cs
- ConnectionManagementElementCollection.cs
- SafeThemeHandle.cs
- SessionState.cs
- XmlWriterDelegator.cs
- IInstanceTable.cs
- SiteIdentityPermission.cs
- UdpContractFilterBehavior.cs
- Mapping.cs
- FileStream.cs
- CFStream.cs