Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / System / data / design / InternalException.cs / 1 / InternalException.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All Rights Reserved. // Information Contained Herein is Proprietary and Confidential. // //----------------------------------------------------------------------------- /* */ namespace System.Data.Design { using System; using System.Design; using System.Diagnostics; using System.Runtime.Serialization; [Serializable] internal class InternalException : Exception, ISerializable { private const string internalExceptionMessageID = "ERR_INTERNAL"; private string internalMessage = String.Empty; // showErrorMesageOnReport let you hide the sensitive error msg to the end user. private bool showErrorMesageOnReport; private int errorCode = -1; internal InternalException(string internalMessage) : this(internalMessage, null) {} internal InternalException(string internalMessage, Exception innerException): this(innerException, internalMessage, -1, false) { } internal InternalException(string internalMessage, int errorCode): this(null, internalMessage, errorCode, false) { } internal InternalException(string internalMessage, int errorCode, bool showTextOnReport): this(null, internalMessage, errorCode, showTextOnReport) { } internal InternalException(Exception innerException, string internalMessage, int errorCode, bool showErrorMesageOnReport) : this(innerException, internalMessage, errorCode, showErrorMesageOnReport, true) { } internal InternalException(Exception innerException, string internalMessage, int errorCode, bool showErrorMesageOnReport, bool needAssert) : base(SR.GetString(internalExceptionMessageID), innerException) { this.errorCode = errorCode; this.showErrorMesageOnReport = showErrorMesageOnReport; if (needAssert) { Debug.Fail(internalMessage); } } private InternalException(SerializationInfo info, StreamingContext context) : base(info, context){ internalMessage = info.GetString("InternalMessage"); errorCode = info.GetInt32("ErrorCode"); showErrorMesageOnReport = info.GetBoolean("ShowErrorMesageOnReport"); } void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context){ info.AddValue("InternalMessage", internalMessage); info.AddValue("ErrorCode", errorCode); info.AddValue("ShowErrorMesageOnReport", showErrorMesageOnReport); base.GetObjectData(info, context); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlDataSourceStatusEventArgs.cs
- RuleSettingsCollection.cs
- CookielessData.cs
- ScriptingJsonSerializationSection.cs
- MailDefinition.cs
- SHA512.cs
- FlowPosition.cs
- OleDbReferenceCollection.cs
- CheckBoxRenderer.cs
- MetadataCache.cs
- ConsoleKeyInfo.cs
- SerializationStore.cs
- PagesSection.cs
- Table.cs
- TreeNodeEventArgs.cs
- SelectionPatternIdentifiers.cs
- GenericTypeParameterBuilder.cs
- CodeValidator.cs
- ManagementQuery.cs
- ToolConsole.cs
- TagMapInfo.cs
- FieldToken.cs
- HorizontalAlignConverter.cs
- BitmapEffectCollection.cs
- PolicyException.cs
- isolationinterop.cs
- HeaderUtility.cs
- GcHandle.cs
- _NativeSSPI.cs
- RelatedEnd.cs
- DataServiceException.cs
- HttpProxyTransportBindingElement.cs
- BitmapEffectDrawing.cs
- PeerTransportBindingElement.cs
- ListViewContainer.cs
- DSASignatureDeformatter.cs
- SecurityContext.cs
- WebExceptionStatus.cs
- Screen.cs
- EntityCollection.cs
- StatusCommandUI.cs
- ComponentDispatcherThread.cs
- SecondaryIndex.cs
- SiteMapDataSource.cs
- PlainXmlSerializer.cs
- ServiceMetadataContractBehavior.cs
- ManagementPath.cs
- ProfessionalColors.cs
- QilList.cs
- ProtocolsConfiguration.cs
- WindowsFormsLinkLabel.cs
- StorageFunctionMapping.cs
- BatchStream.cs
- SqlBuilder.cs
- CommonRemoteMemoryBlock.cs
- XmlAttribute.cs
- IndexedString.cs
- HttpInputStream.cs
- TextPatternIdentifiers.cs
- SymmetricAlgorithm.cs
- DiscoveryExceptionDictionary.cs
- WinFormsComponentEditor.cs
- RawStylusInputCustomData.cs
- HtmlMeta.cs
- WebPartDisplayModeCollection.cs
- LinkButton.cs
- Html32TextWriter.cs
- IUnknownConstantAttribute.cs
- DataBoundLiteralControl.cs
- ValueTypeFixupInfo.cs
- ServiceNameElement.cs
- Utils.cs
- GetPageCompletedEventArgs.cs
- HintTextConverter.cs
- WebPartManagerInternals.cs
- SetterBase.cs
- TemplateColumn.cs
- future.cs
- TextEditorCopyPaste.cs
- IMembershipProvider.cs
- EventSetter.cs
- CmsInterop.cs
- UnaryNode.cs
- Boolean.cs
- ReadOnlyAttribute.cs
- RtType.cs
- LinkLabel.cs
- FileSystemInfo.cs
- TriggerCollection.cs
- Lasso.cs
- TextEndOfParagraph.cs
- COM2Properties.cs
- TemplateAction.cs
- BitmapEffect.cs
- XmlSchemaInfo.cs
- GridViewRowEventArgs.cs
- EventLogInternal.cs
- VirtualizingStackPanel.cs
- HttpWebRequest.cs
- EventlogProvider.cs