Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- EpmContentDeSerializer.cs
- PreloadedPackages.cs
- Unit.cs
- Timer.cs
- FormViewUpdateEventArgs.cs
- SecurityImpersonationBehavior.cs
- MappedMetaModel.cs
- SchemaImporterExtension.cs
- DefaultMemberAttribute.cs
- StorageInfo.cs
- typedescriptorpermission.cs
- TemplateControl.cs
- VisualStyleRenderer.cs
- SamlAuthorizationDecisionStatement.cs
- TypeTypeConverter.cs
- MouseGestureConverter.cs
- FixedStringLookup.cs
- XmlBinaryWriterSession.cs
- errorpatternmatcher.cs
- QueryGeneratorBase.cs
- RenameRuleObjectDialog.Designer.cs
- RegexWorker.cs
- TreeNodeStyleCollection.cs
- BasicKeyConstraint.cs
- EmptyCollection.cs
- EndpointIdentityConverter.cs
- Page.cs
- ContextStaticAttribute.cs
- SerializationObjectManager.cs
- FunctionUpdateCommand.cs
- XmlWellformedWriterHelpers.cs
- sqlser.cs
- HttpListenerPrefixCollection.cs
- DomainUpDown.cs
- Exceptions.cs
- Roles.cs
- ModelItem.cs
- Function.cs
- bidPrivateBase.cs
- MostlySingletonList.cs
- HitTestParameters3D.cs
- ColorInterpolationModeValidation.cs
- FileVersion.cs
- RSAPKCS1SignatureDeformatter.cs
- StorageMappingItemLoader.cs
- HScrollProperties.cs
- DateTimeFormat.cs
- MetabaseServerConfig.cs
- RectValueSerializer.cs
- CodeTypeParameterCollection.cs
- ValidatedControlConverter.cs
- SqlCacheDependencyDatabaseCollection.cs
- RedistVersionInfo.cs
- ReadContentAsBinaryHelper.cs
- Registry.cs
- Documentation.cs
- RightsManagementPermission.cs
- AnonymousIdentificationModule.cs
- SecurityElement.cs
- WebPartExportVerb.cs
- CodeCompileUnit.cs
- PropertyPushdownHelper.cs
- Message.cs
- QuestionEventArgs.cs
- OpCodes.cs
- CancelRequestedQuery.cs
- CornerRadius.cs
- NativeWindow.cs
- UrlAuthFailedErrorFormatter.cs
- IPCCacheManager.cs
- HtmlInputFile.cs
- ZoneIdentityPermission.cs
- StructuredTypeEmitter.cs
- ConfigXmlAttribute.cs
- ListViewDesigner.cs
- TextStore.cs
- RedBlackList.cs
- ResXFileRef.cs
- SequenceDesignerAccessibleObject.cs
- SpeechEvent.cs
- ExpressionConverter.cs
- SqlFunctionAttribute.cs
- SourceElementsCollection.cs
- _OverlappedAsyncResult.cs
- IndexerNameAttribute.cs
- PeerToPeerException.cs
- PersistenceTypeAttribute.cs
- SiteMapDataSourceView.cs
- Attributes.cs
- DataBindingHandlerAttribute.cs
- SqlMethodCallConverter.cs
- JavascriptCallbackBehaviorAttribute.cs
- TableSectionStyle.cs
- HttpListener.cs
- CachedFontFace.cs
- WrapperEqualityComparer.cs
- SqlProfileProvider.cs
- DecimalConverter.cs
- X509SubjectKeyIdentifierClause.cs
- IpcClientManager.cs