Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / ThrowOnMultipleAssignment.cs / 1305376 / ThrowOnMultipleAssignment.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using Microsoft.InfoCards.Diagnostics; using IDT=Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary: // This class throws an Argument exception if an attempt is made to assign a non-null // value to the Value property more than once. // class ThrowOnMultipleAssignment{ string m_errorString; T m_value; public T Value { get { return m_value; } set { if( null != m_value && null != value ) { throw IDT.ThrowHelperArgument( m_errorString ); } else if( null == m_value ) { m_value = value; } } } // // Parameters: // errorString - If Value gets assigned to more than once an argument exception will be thrown with this // string as the Exception string. // public ThrowOnMultipleAssignment( string errorString ) { IDT.DebugAssert( !String.IsNullOrEmpty( errorString ), "Must have an error string" ); m_errorString = errorString; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using Microsoft.InfoCards.Diagnostics; using IDT=Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary: // This class throws an Argument exception if an attempt is made to assign a non-null // value to the Value property more than once. // class ThrowOnMultipleAssignment { string m_errorString; T m_value; public T Value { get { return m_value; } set { if( null != m_value && null != value ) { throw IDT.ThrowHelperArgument( m_errorString ); } else if( null == m_value ) { m_value = value; } } } // // Parameters: // errorString - If Value gets assigned to more than once an argument exception will be thrown with this // string as the Exception string. // public ThrowOnMultipleAssignment( string errorString ) { IDT.DebugAssert( !String.IsNullOrEmpty( errorString ), "Must have an error string" ); m_errorString = errorString; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
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
- DataGridPagingPage.cs
- DataRowChangeEvent.cs
- ReverseComparer.cs
- StrokeCollection.cs
- TableLayoutStyleCollection.cs
- Geometry3D.cs
- SystemException.cs
- XmlDocument.cs
- XmlSecureResolver.cs
- HandlerFactoryWrapper.cs
- NativeCppClassAttribute.cs
- WindowsSolidBrush.cs
- XmlILConstructAnalyzer.cs
- DataGridViewCellCancelEventArgs.cs
- SslStream.cs
- ObjectDataSourceDisposingEventArgs.cs
- Vector3DKeyFrameCollection.cs
- VoiceChangeEventArgs.cs
- FileNotFoundException.cs
- TemplateControlBuildProvider.cs
- MimeParameterWriter.cs
- MasterPage.cs
- FixedHyperLink.cs
- WebPartCollection.cs
- FixedSOMSemanticBox.cs
- ProgressiveCrcCalculatingStream.cs
- TypeLibConverter.cs
- EmptyStringExpandableObjectConverter.cs
- Page.cs
- ServiceContractGenerator.cs
- Trace.cs
- FunctionQuery.cs
- PageClientProxyGenerator.cs
- ButtonColumn.cs
- FieldTemplateFactory.cs
- PriorityQueue.cs
- AttachedPropertyDescriptor.cs
- Proxy.cs
- FileRecordSequenceHelper.cs
- ScrollChrome.cs
- GridViewRowEventArgs.cs
- Win32Native.cs
- Socket.cs
- EntityDataSourceQueryBuilder.cs
- DbQueryCommandTree.cs
- AssemblyName.cs
- WebFormsRootDesigner.cs
- PageThemeParser.cs
- HMACSHA512.cs
- ActiveXHelper.cs
- ActionItem.cs
- IndentTextWriter.cs
- SystemTcpStatistics.cs
- SpoolingTaskBase.cs
- Point4DConverter.cs
- SystemNetworkInterface.cs
- FunctionNode.cs
- XmlSchemaAny.cs
- BuildManagerHost.cs
- EventLogSession.cs
- ModelTreeEnumerator.cs
- ServiceDescriptionSerializer.cs
- DesignBindingEditor.cs
- sqlser.cs
- TemplatingOptionsDialog.cs
- SmiEventStream.cs
- CodeMemberEvent.cs
- SettingsBindableAttribute.cs
- TemplateBaseAction.cs
- SqlBulkCopyColumnMappingCollection.cs
- OracleFactory.cs
- WebDisplayNameAttribute.cs
- ParserContext.cs
- GridEntryCollection.cs
- ProcessModelInfo.cs
- DefaultHttpHandler.cs
- GPStream.cs
- DbInsertCommandTree.cs
- StyleModeStack.cs
- LinqDataSourceView.cs
- XmlSortKey.cs
- ErrorTableItemStyle.cs
- CodeSnippetExpression.cs
- Int32RectConverter.cs
- PropertyStore.cs
- SspiSafeHandles.cs
- RegisteredExpandoAttribute.cs
- SoapSchemaImporter.cs
- EmbossBitmapEffect.cs
- FontCacheUtil.cs
- Parser.cs
- DataGridViewUtilities.cs
- BlurEffect.cs
- PointUtil.cs
- TcpTransportManager.cs
- __ComObject.cs
- StrokeFIndices.cs
- OdbcConnection.cs
- FormViewRow.cs
- BlockUIContainer.cs