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
- SqlDataSourceAdvancedOptionsForm.cs
- EvidenceTypeDescriptor.cs
- SmiRecordBuffer.cs
- RoleService.cs
- ProgressBar.cs
- Bind.cs
- ZipIOExtraFieldZip64Element.cs
- SqlFileStream.cs
- AppDomainProtocolHandler.cs
- BasicExpressionVisitor.cs
- Stopwatch.cs
- login.cs
- TrustLevelCollection.cs
- InteropEnvironment.cs
- DerivedKeySecurityToken.cs
- ServiceNotStartedException.cs
- GenerateTemporaryTargetAssembly.cs
- LeaseManager.cs
- PackUriHelper.cs
- CodePageUtils.cs
- MatrixTransform.cs
- FaultCallbackWrapper.cs
- EnvelopedPkcs7.cs
- ArraySegment.cs
- DbConnectionFactory.cs
- ItemType.cs
- RemotingException.cs
- XmlSchemaObject.cs
- MinMaxParagraphWidth.cs
- EntityKey.cs
- DetailsViewInsertedEventArgs.cs
- XamlTemplateSerializer.cs
- ClientConvert.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- _CookieModule.cs
- SudsWriter.cs
- EditingCommands.cs
- CodeStatementCollection.cs
- DPTypeDescriptorContext.cs
- WhitespaceRuleReader.cs
- EventData.cs
- DataKeyCollection.cs
- DoWorkEventArgs.cs
- XmlQueryStaticData.cs
- PkcsUtils.cs
- DLinqColumnProvider.cs
- Publisher.cs
- BitmapDownload.cs
- DataControlPagerLinkButton.cs
- ToolboxComponentsCreatingEventArgs.cs
- DataViewSetting.cs
- TextParagraph.cs
- SystemWebExtensionsSectionGroup.cs
- WpfKnownType.cs
- WebPartAddingEventArgs.cs
- MethodExecutor.cs
- ConfigXmlWhitespace.cs
- dsa.cs
- GroupBox.cs
- RawStylusSystemGestureInputReport.cs
- OrthographicCamera.cs
- DataGridViewDataErrorEventArgs.cs
- TextRunCache.cs
- BitmapFrame.cs
- ConfigurationStrings.cs
- StatusBarItem.cs
- WebPartConnectionCollection.cs
- QilIterator.cs
- ControlParameter.cs
- cookie.cs
- SinglePageViewer.cs
- DataObjectAttribute.cs
- ConfigurationPropertyCollection.cs
- PageBuildProvider.cs
- SurrogateDataContract.cs
- StorageMappingItemCollection.cs
- SafeBitVector32.cs
- DataControlFieldHeaderCell.cs
- LostFocusEventManager.cs
- CngUIPolicy.cs
- SupportingTokenSpecification.cs
- XmlBuffer.cs
- SessionPageStateSection.cs
- LinqDataSourceInsertEventArgs.cs
- ImageCollectionCodeDomSerializer.cs
- Translator.cs
- JapaneseCalendar.cs
- XsltArgumentList.cs
- Hyperlink.cs
- MetadataItem.cs
- Blend.cs
- ProjectionAnalyzer.cs
- SessionStateSection.cs
- MeasurementDCInfo.cs
- VectorAnimation.cs
- ResourceAttributes.cs
- RegexRunnerFactory.cs
- WindowProviderWrapper.cs
- HtmlElement.cs
- NamespaceCollection.cs