Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / ArgumentException.cs / 1 / ArgumentException.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: ArgumentException ** ** ** Purpose: Exception class for invalid arguments to a method. ** ** =============================================================================*/ namespace System { using System; using System.Runtime.Remoting; using System.Runtime.Serialization; using System.Globalization; using System.Security.Permissions; // The ArgumentException is thrown when an argument does not meet // the contract of the method. Ideally it should give a meaningful error // message describing what was wrong and which parameter is incorrect. // [System.Runtime.InteropServices.ComVisible(true)] [Serializable()] public class ArgumentException : SystemException, ISerializable { private String m_paramName; // Creates a new ArgumentException with its message // string set to the empty string. public ArgumentException() : base(Environment.GetResourceString("Arg_ArgumentException")) { SetErrorCode(__HResults.COR_E_ARGUMENT); } // Creates a new ArgumentException with its message // string set to message. // public ArgumentException(String message) : base(message) { SetErrorCode(__HResults.COR_E_ARGUMENT); } public ArgumentException(String message, Exception innerException) : base(message, innerException) { SetErrorCode(__HResults.COR_E_ARGUMENT); } public ArgumentException(String message, String paramName, Exception innerException) : base(message, innerException) { m_paramName = paramName; SetErrorCode(__HResults.COR_E_ARGUMENT); } public ArgumentException (String message, String paramName) : base (message) { m_paramName = paramName; SetErrorCode(__HResults.COR_E_ARGUMENT); } protected ArgumentException(SerializationInfo info, StreamingContext context) : base(info, context) { m_paramName = info.GetString("ParamName"); } public override String Message { get { String s = base.Message; if (! ((m_paramName == null) || (m_paramName.Length == 0)) ) return s + Environment.NewLine + String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Arg_ParamName_Name"), m_paramName); else return s; } } public virtual String ParamName { get { return m_paramName; } } [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.SerializationFormatter)] public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info==null) { throw new ArgumentNullException("info"); } base.GetObjectData(info, context); info.AddValue("ParamName", m_paramName, typeof(String)); } } } // 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
- XamlToRtfWriter.cs
- LogicalExpr.cs
- GACIdentityPermission.cs
- ToolStripOverflow.cs
- HebrewCalendar.cs
- XmlSequenceWriter.cs
- LinqDataSourceView.cs
- ChtmlCalendarAdapter.cs
- CollectionConverter.cs
- ProcessModelSection.cs
- BlobPersonalizationState.cs
- ContourSegment.cs
- RegistryDataKey.cs
- EventMetadata.cs
- XsdDataContractExporter.cs
- EndpointConfigContainer.cs
- Debug.cs
- MatrixIndependentAnimationStorage.cs
- ExtentCqlBlock.cs
- DataGridViewTopRowAccessibleObject.cs
- D3DImage.cs
- SqlParameter.cs
- baseaxisquery.cs
- ExpanderAutomationPeer.cs
- WebFormDesignerActionService.cs
- InvalidateEvent.cs
- ImmComposition.cs
- RightsManagementManager.cs
- StackOverflowException.cs
- SourceChangedEventArgs.cs
- PolyBezierSegment.cs
- CharAnimationUsingKeyFrames.cs
- HttpTransportSecurityElement.cs
- XPathAncestorQuery.cs
- SubstitutionDesigner.cs
- WindowsListBox.cs
- AssemblyBuilderData.cs
- ProtocolInformationReader.cs
- DataGridLengthConverter.cs
- MailMessage.cs
- UriScheme.cs
- IdentityNotMappedException.cs
- XmlExtensionFunction.cs
- CFGGrammar.cs
- ButtonFieldBase.cs
- SystemMulticastIPAddressInformation.cs
- EDesignUtil.cs
- shaper.cs
- BitmapSourceSafeMILHandle.cs
- SocketCache.cs
- WebPartMenu.cs
- XmlElementList.cs
- SmiContext.cs
- FlowDocumentFormatter.cs
- MailWriter.cs
- Focus.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- UserControlBuildProvider.cs
- RangeValuePattern.cs
- HttpRequestCacheValidator.cs
- XmlQueryTypeFactory.cs
- Dynamic.cs
- _DomainName.cs
- Crc32.cs
- HttpWebResponse.cs
- PrefixQName.cs
- BasicCellRelation.cs
- DecoderBestFitFallback.cs
- CultureTable.cs
- SRef.cs
- UrlMappingsSection.cs
- X500Name.cs
- MergePropertyDescriptor.cs
- WebBrowsableAttribute.cs
- RegistryKey.cs
- DataContext.cs
- XmlWhitespace.cs
- Variant.cs
- PolicyLevel.cs
- DataGridViewDataConnection.cs
- CodeCompileUnit.cs
- ResourceAssociationTypeEnd.cs
- AxHost.cs
- columnmapkeybuilder.cs
- DataGridBoolColumn.cs
- XmlSchemaCollection.cs
- ValueTypePropertyReference.cs
- BitmapImage.cs
- AccessViolationException.cs
- SoapEnumAttribute.cs
- EmptyElement.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- BitmapSource.cs
- TypedRowHandler.cs
- DocumentGridContextMenu.cs
- ArrangedElementCollection.cs
- PagesChangedEventArgs.cs
- SqlError.cs
- ReferenceEqualityComparer.cs
- StagingAreaInputItem.cs