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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BinaryObjectInfo.cs
- CombinedGeometry.cs
- ProjectionRewriter.cs
- SemanticTag.cs
- SortedList.cs
- SimpleWebHandlerParser.cs
- Exceptions.cs
- TextTrailingWordEllipsis.cs
- List.cs
- PartDesigner.cs
- RegexWriter.cs
- TdsParser.cs
- ContainerUtilities.cs
- PenCursorManager.cs
- ResolveMatchesMessage11.cs
- SelectionRange.cs
- XmlDeclaration.cs
- OdbcEnvironment.cs
- SchemaExporter.cs
- VectorAnimationBase.cs
- RuntimeVariablesExpression.cs
- ManagementException.cs
- XmlResolver.cs
- Input.cs
- TraceProvider.cs
- MasterPage.cs
- Block.cs
- ClientSideQueueItem.cs
- HtmlContainerControl.cs
- ViewDesigner.cs
- SplineKeyFrames.cs
- SelectionService.cs
- SqlInternalConnection.cs
- BookmarkEventArgs.cs
- AttachedAnnotation.cs
- CompilerGeneratedAttribute.cs
- BaseValidatorDesigner.cs
- BamlVersionHeader.cs
- FrameworkElement.cs
- TabControl.cs
- ZoomPercentageConverter.cs
- CachedTypeface.cs
- remotingproxy.cs
- ObjectTag.cs
- Point4D.cs
- XmlElementElement.cs
- InstanceNameConverter.cs
- BasePattern.cs
- ToolStripItemClickedEventArgs.cs
- ProfessionalColors.cs
- ToRequest.cs
- translator.cs
- ItemsControlAutomationPeer.cs
- UrlPath.cs
- BaseDataBoundControl.cs
- UpdateCommand.cs
- TypedAsyncResult.cs
- MediaCommands.cs
- Deflater.cs
- IdnElement.cs
- FixedPosition.cs
- DocumentViewer.cs
- CaseInsensitiveOrdinalStringComparer.cs
- ListViewUpdatedEventArgs.cs
- ObjectView.cs
- Visual3D.cs
- MDIClient.cs
- DnsElement.cs
- AppLevelCompilationSectionCache.cs
- Image.cs
- FigureHelper.cs
- Point4D.cs
- ResourceDefaultValueAttribute.cs
- ZipFileInfoCollection.cs
- XmlEncoding.cs
- AnnotationMap.cs
- CodeDOMUtility.cs
- PropertyExpression.cs
- WebPartConnectionsEventArgs.cs
- VisualTarget.cs
- Geometry.cs
- RowType.cs
- ListChunk.cs
- WeakEventTable.cs
- AsyncCodeActivity.cs
- RsaSecurityTokenParameters.cs
- xamlnodes.cs
- Touch.cs
- XmlEnumAttribute.cs
- UnknownBitmapDecoder.cs
- SqlDataSourceFilteringEventArgs.cs
- ThreadStaticAttribute.cs
- FixedTextContainer.cs
- UrlPath.cs
- UnauthorizedWebPart.cs
- FileAccessException.cs
- ResourcePermissionBase.cs
- InstalledFontCollection.cs
- HttpListenerElement.cs
- JsonUriDataContract.cs