Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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)); } } }
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FixUpCollection.cs
- InvalidPrinterException.cs
- SHA1Cng.cs
- SerializationEventsCache.cs
- EnvelopedPkcs7.cs
- CompilerParameters.cs
- BaseInfoTable.cs
- IndexingContentUnit.cs
- ETagAttribute.cs
- DockPattern.cs
- AuthorizationRule.cs
- DocumentSequenceHighlightLayer.cs
- DbParameterCollectionHelper.cs
- COM2IDispatchConverter.cs
- DynamicILGenerator.cs
- HtmlMeta.cs
- SqlUnionizer.cs
- Column.cs
- Attributes.cs
- COM2EnumConverter.cs
- ObjectConverter.cs
- OpenFileDialog.cs
- GifBitmapDecoder.cs
- ConnectionManagementElementCollection.cs
- TypeConstant.cs
- BindingGroup.cs
- Figure.cs
- TextServicesContext.cs
- ProfileServiceManager.cs
- Quaternion.cs
- ObjectAssociationEndMapping.cs
- MapPathBasedVirtualPathProvider.cs
- EditorBrowsableAttribute.cs
- HandleCollector.cs
- TreeView.cs
- FormViewInsertedEventArgs.cs
- ContextProperty.cs
- DBDataPermission.cs
- DrawingGroupDrawingContext.cs
- RegionData.cs
- TokenBasedSet.cs
- ExpressionBuilder.cs
- FillRuleValidation.cs
- XmlSchemaComplexContentRestriction.cs
- ReferencedType.cs
- AspCompat.cs
- GraphicsState.cs
- TextBox.cs
- Sequence.cs
- PointAnimationBase.cs
- Util.cs
- ActivationServices.cs
- CodeSnippetCompileUnit.cs
- Inflater.cs
- PaperSource.cs
- EventLogHandle.cs
- WebPartUtil.cs
- HttpListenerResponse.cs
- SoapServerProtocol.cs
- QueryExtender.cs
- SharedStatics.cs
- BuildProviderInstallComponent.cs
- ReferenceEqualityComparer.cs
- ScrollEventArgs.cs
- XhtmlBasicPageAdapter.cs
- WebColorConverter.cs
- NavigateEvent.cs
- RuleCache.cs
- TransformerConfigurationWizardBase.cs
- DataGridPageChangedEventArgs.cs
- TypeDelegator.cs
- WebScriptClientGenerator.cs
- Content.cs
- ButtonColumn.cs
- DataSourceSelectArguments.cs
- XmlSchemaSet.cs
- BitArray.cs
- TextEditorThreadLocalStore.cs
- DataGridViewCellStyle.cs
- RootNamespaceAttribute.cs
- GroupBox.cs
- PathParser.cs
- AnnotationResource.cs
- DataGridViewCellStateChangedEventArgs.cs
- BoolExpression.cs
- State.cs
- CollectionChangedEventManager.cs
- FormattedText.cs
- ApplicationSecurityInfo.cs
- AttachmentCollection.cs
- DeadCharTextComposition.cs
- DataGridViewCellMouseEventArgs.cs
- uribuilder.cs
- RuntimeDelegateArgument.cs
- ItemsPresenter.cs
- ChangePassword.cs
- SectionVisual.cs
- CodeExporter.cs
- CodeRemoveEventStatement.cs
- HttpBrowserCapabilitiesWrapper.cs