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
- EntityDataSourceChangedEventArgs.cs
- SeekableReadStream.cs
- X509SecurityTokenAuthenticator.cs
- VisualBasicSettingsHandler.cs
- ManagementObjectCollection.cs
- _NestedSingleAsyncResult.cs
- ILGenerator.cs
- CFStream.cs
- TypeViewSchema.cs
- AVElementHelper.cs
- XmlWriter.cs
- BitFlagsGenerator.cs
- ReferencedType.cs
- RowSpanVector.cs
- RangeValueProviderWrapper.cs
- ProfilePropertyMetadata.cs
- CheckBox.cs
- ReservationNotFoundException.cs
- ReadWriteSpinLock.cs
- CompiledAction.cs
- TaskHelper.cs
- XamlSerializer.cs
- ObservableCollection.cs
- ThicknessAnimation.cs
- Action.cs
- ProtocolsConfigurationEntry.cs
- SetterBaseCollection.cs
- DocumentsTrace.cs
- StylusButton.cs
- HwndAppCommandInputProvider.cs
- RadioButtonList.cs
- NameObjectCollectionBase.cs
- Compensate.cs
- VariableReference.cs
- BufferCache.cs
- InnerItemCollectionView.cs
- WindowsImpersonationContext.cs
- ArraySet.cs
- IdentityReference.cs
- PaintEvent.cs
- LogRecordSequence.cs
- WebFormDesignerActionService.cs
- SecurityDocument.cs
- WebPartHelpVerb.cs
- NativeMethods.cs
- ParseChildrenAsPropertiesAttribute.cs
- TokenizerHelper.cs
- KeyValuePair.cs
- SharedPerformanceCounter.cs
- SymbolEqualComparer.cs
- ConcurrentBag.cs
- SqlNode.cs
- DupHandleConnectionReader.cs
- FrameworkPropertyMetadata.cs
- ModuleConfigurationInfo.cs
- PrintControllerWithStatusDialog.cs
- XmlSchemaSimpleContentExtension.cs
- FaultImportOptions.cs
- ConcurrentQueue.cs
- LocalBuilder.cs
- MdImport.cs
- Rijndael.cs
- DataBindingHandlerAttribute.cs
- PermissionSet.cs
- HMACSHA512.cs
- DoubleAnimation.cs
- StreamedFramingRequestChannel.cs
- IconBitmapDecoder.cs
- UseManagedPresentationElement.cs
- ParameterElementCollection.cs
- DtcInterfaces.cs
- CaseInsensitiveHashCodeProvider.cs
- XdrBuilder.cs
- Library.cs
- ToolstripProfessionalRenderer.cs
- COSERVERINFO.cs
- XmlSchemaComplexType.cs
- Vector.cs
- SqlWebEventProvider.cs
- DataSourceCache.cs
- MethodBuilderInstantiation.cs
- XslAst.cs
- DesignerAttribute.cs
- EntitySqlQueryBuilder.cs
- WorkflowRuntimeServiceElementCollection.cs
- JapaneseCalendar.cs
- WrappedReader.cs
- SmtpDigestAuthenticationModule.cs
- RequiredAttributeAttribute.cs
- SoapAttributeOverrides.cs
- AstNode.cs
- RealizedColumnsBlock.cs
- TypeSystemHelpers.cs
- DataGridTextBoxColumn.cs
- PathData.cs
- XhtmlConformanceSection.cs
- x509store.cs
- CalendarDay.cs
- PrimitiveOperationFormatter.cs
- HideDisabledControlAdapter.cs