Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- WindowInteropHelper.cs
- CodeMemberProperty.cs
- RegexReplacement.cs
- WebPartUserCapability.cs
- Color.cs
- COM2IProvidePropertyBuilderHandler.cs
- DecimalStorage.cs
- OneOfScalarConst.cs
- Token.cs
- WSTrustDec2005.cs
- MessageLogger.cs
- NumberFormatInfo.cs
- ListenerElementsCollection.cs
- GeometryDrawing.cs
- FunctionUpdateCommand.cs
- EntityCommandCompilationException.cs
- TreeNodeCollection.cs
- ZipIOLocalFileHeader.cs
- Application.cs
- CompatibleComparer.cs
- ReadOnlyCollection.cs
- StopRoutingHandler.cs
- CorrelationService.cs
- LazyInitializer.cs
- WebPartTransformer.cs
- SwitchAttribute.cs
- GeneralTransformGroup.cs
- PreservationFileReader.cs
- LiteralText.cs
- EntityException.cs
- CachedTypeface.cs
- documentation.cs
- ColumnResizeUndoUnit.cs
- InstanceView.cs
- SchemaTableColumn.cs
- OdbcDataReader.cs
- LocalFileSettingsProvider.cs
- PropertyGrid.cs
- RoleGroup.cs
- ExternalException.cs
- Common.cs
- FrameworkElementAutomationPeer.cs
- XmlTextAttribute.cs
- DocumentCollection.cs
- OleDbConnection.cs
- DetailsView.cs
- nulltextnavigator.cs
- RsaKeyIdentifierClause.cs
- ParallelTimeline.cs
- CustomError.cs
- xmlfixedPageInfo.cs
- DrawingAttributesDefaultValueFactory.cs
- CommonDialog.cs
- DbParameterCollection.cs
- OrderByQueryOptionExpression.cs
- DataTable.cs
- CaseInsensitiveComparer.cs
- IxmlLineInfo.cs
- StatusBarItemAutomationPeer.cs
- HighlightVisual.cs
- LocalizedNameDescriptionPair.cs
- ConfigurationProperty.cs
- DesignerMetadata.cs
- webclient.cs
- SystemColors.cs
- ThemeInfoAttribute.cs
- RequestCacheValidator.cs
- Transform3DGroup.cs
- NameObjectCollectionBase.cs
- TypeDelegator.cs
- StreamInfo.cs
- ResourcePermissionBaseEntry.cs
- DecryptRequest.cs
- TextAdaptor.cs
- PassportPrincipal.cs
- ConnectionsZone.cs
- DesignerGenericWebPart.cs
- Rule.cs
- Point3DAnimationUsingKeyFrames.cs
- PlainXmlWriter.cs
- WorkflowInstanceProvider.cs
- CalendarDay.cs
- ManipulationCompletedEventArgs.cs
- MethodBody.cs
- SchemaDeclBase.cs
- ListComponentEditor.cs
- filewebrequest.cs
- _LazyAsyncResult.cs
- PlacementWorkspace.cs
- DoubleLinkList.cs
- PropertyMapper.cs
- PrivateFontCollection.cs
- TypeAccessException.cs
- OpenFileDialog.cs
- MimeTypeAttribute.cs
- LogSwitch.cs
- TdsEnums.cs
- CodeArrayIndexerExpression.cs
- Timer.cs
- Transform3D.cs