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
- XmlHierarchyData.cs
- FieldBuilder.cs
- LoginUtil.cs
- ClientCultureInfo.cs
- VectorConverter.cs
- TemplatePropertyEntry.cs
- FormViewInsertedEventArgs.cs
- FixedPosition.cs
- PingOptions.cs
- CodeIndexerExpression.cs
- Ipv6Element.cs
- DesignTimeVisibleAttribute.cs
- RedirectionProxy.cs
- OdbcConnectionString.cs
- IntSumAggregationOperator.cs
- DataServiceQueryProvider.cs
- XPathBinder.cs
- UniqueIdentifierService.cs
- SqlXmlStorage.cs
- WindowsListViewItemStartMenu.cs
- CopyAction.cs
- DataViewManagerListItemTypeDescriptor.cs
- NativeMethods.cs
- CompiledQuery.cs
- SmtpDateTime.cs
- SignedXmlDebugLog.cs
- SerialReceived.cs
- RowsCopiedEventArgs.cs
- BinarySerializer.cs
- SchemaElement.cs
- COM2PropertyPageUITypeConverter.cs
- ServiceOperationParameter.cs
- ObjectKeyFrameCollection.cs
- TriState.cs
- ScrollBar.cs
- WebScriptMetadataMessage.cs
- SchemaCreator.cs
- HtmlInputReset.cs
- HwndProxyElementProvider.cs
- UIElementCollection.cs
- EventListenerClientSide.cs
- FixedDocumentPaginator.cs
- MatrixStack.cs
- AsyncSerializedWorker.cs
- BitFlagsGenerator.cs
- SHA1Managed.cs
- WebPartExportVerb.cs
- SettingsPropertyValue.cs
- BitmapEffect.cs
- KeyConverter.cs
- CodePageEncoding.cs
- Normalization.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- DependencyObjectValidator.cs
- ToolStripComboBox.cs
- LocalBuilder.cs
- RectAnimationUsingKeyFrames.cs
- ProfileSettings.cs
- DbProviderConfigurationHandler.cs
- TimerElapsedEvenArgs.cs
- PerformanceCounterScope.cs
- WebPartTransformerAttribute.cs
- CalendarDay.cs
- XpsSerializerWriter.cs
- WebPartDisplayModeEventArgs.cs
- ConvertersCollection.cs
- ObjectDesignerDataSourceView.cs
- ScriptDescriptor.cs
- GeometryGroup.cs
- ActivationServices.cs
- XMLDiffLoader.cs
- EventSetter.cs
- BodyGlyph.cs
- OdbcHandle.cs
- LineVisual.cs
- BooleanStorage.cs
- DockAndAnchorLayout.cs
- ImageBrush.cs
- InheritanceRules.cs
- DataControlImageButton.cs
- TextStore.cs
- UserMapPath.cs
- PerformanceCounterManager.cs
- SiteMapNodeItemEventArgs.cs
- WebEvents.cs
- DocComment.cs
- UpdateRecord.cs
- QilInvoke.cs
- safelinkcollection.cs
- ValidationErrorInfo.cs
- MenuItemAutomationPeer.cs
- StateBag.cs
- XmlObjectSerializerWriteContext.cs
- DataServiceBehavior.cs
- CommandBinding.cs
- DesignTimeTemplateParser.cs
- DocumentViewerAutomationPeer.cs
- XamlSerializer.cs
- ThemeInfoAttribute.cs
- RawStylusInputReport.cs