Code:
/ FX-1434 / FX-1434 / 1.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
- XPathNodeInfoAtom.cs
- OrderByBuilder.cs
- ApplicationHost.cs
- XamlClipboardData.cs
- CopyAction.cs
- MultiView.cs
- Binding.cs
- WindowsRichEditRange.cs
- FormViewDeletedEventArgs.cs
- DbProviderFactories.cs
- StreamingContext.cs
- METAHEADER.cs
- Fonts.cs
- BamlRecordWriter.cs
- WebScriptServiceHostFactory.cs
- MinimizableAttributeTypeConverter.cs
- MaskedTextBoxTextEditor.cs
- AuthenticationConfig.cs
- BitConverter.cs
- validationstate.cs
- SQLString.cs
- ContextMenuAutomationPeer.cs
- ToolStripRendererSwitcher.cs
- Wildcard.cs
- ProfileInfo.cs
- WindowPatternIdentifiers.cs
- TextElement.cs
- EditModeSwitchButton.cs
- VSWCFServiceContractGenerator.cs
- WebPartActionVerb.cs
- RepeatInfo.cs
- DebugHandleTracker.cs
- ChannelSinkStacks.cs
- InputBinder.cs
- MemberProjectedSlot.cs
- CategoryAttribute.cs
- WebPartEditorOkVerb.cs
- Token.cs
- DoubleUtil.cs
- InfiniteTimeSpanConverter.cs
- MouseGesture.cs
- HTMLTextWriter.cs
- LoopExpression.cs
- DataGridViewTextBoxEditingControl.cs
- PointCollection.cs
- CoreChannel.cs
- FontStyles.cs
- XmlEncodedRawTextWriter.cs
- FontFamily.cs
- SQLBinary.cs
- SchemaInfo.cs
- LessThan.cs
- TargetConverter.cs
- ButtonFieldBase.cs
- WCFModelStrings.Designer.cs
- RandomNumberGenerator.cs
- ScaleTransform3D.cs
- ProcessHost.cs
- SrgsNameValueTag.cs
- _ListenerResponseStream.cs
- OrthographicCamera.cs
- Token.cs
- UIElement3DAutomationPeer.cs
- HttpHandlerAction.cs
- SqlDataAdapter.cs
- Process.cs
- ObjectHelper.cs
- serverconfig.cs
- ResourceAssociationSetEnd.cs
- TraceUtility.cs
- DesignTimeTemplateParser.cs
- CompositeCollection.cs
- CustomAttributeBuilder.cs
- StylusPointPropertyUnit.cs
- TrustLevel.cs
- TaskbarItemInfo.cs
- Color.cs
- PropertyPathConverter.cs
- Expressions.cs
- ControlCachePolicy.cs
- RankException.cs
- MessagePropertyFilter.cs
- invalidudtexception.cs
- ColumnWidthChangingEvent.cs
- XmlSignatureManifest.cs
- ToolStripInSituService.cs
- datacache.cs
- CodeExporter.cs
- TextBoxBase.cs
- PrintController.cs
- EditorResources.cs
- CryptoApi.cs
- TrustManagerPromptUI.cs
- RMPublishingDialog.cs
- PreviewPageInfo.cs
- BCLDebug.cs
- SerializationHelper.cs
- DataGridViewRowConverter.cs
- MachineKeyValidationConverter.cs
- WindowsListViewItemCheckBox.cs