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
- TypeConstant.cs
- IBuiltInEvidence.cs
- ConfigurationElementCollection.cs
- DictionarySectionHandler.cs
- HtmlInputImage.cs
- ObjectParameter.cs
- ReferenceService.cs
- ClientScriptManager.cs
- ResolveMatches11.cs
- StylusShape.cs
- DataControlFieldCollection.cs
- GeneratedContractType.cs
- HttpDebugHandler.cs
- DataGridCell.cs
- HandlerBase.cs
- DescriptionAttribute.cs
- _WebProxyDataBuilder.cs
- TraceSource.cs
- ExpressionEvaluator.cs
- SqlProcedureAttribute.cs
- PhysicalOps.cs
- DBParameter.cs
- NodeFunctions.cs
- linebase.cs
- arc.cs
- DataGridViewTextBoxColumn.cs
- SelectionItemPattern.cs
- Keywords.cs
- ExtendedPropertyCollection.cs
- TableLayout.cs
- PrintDialog.cs
- Compilation.cs
- Number.cs
- WebPartConnectionsDisconnectVerb.cs
- BitmapInitialize.cs
- AmbientLight.cs
- DefaultMemberAttribute.cs
- UntrustedRecipientException.cs
- IListConverters.cs
- SqlDataSourceSelectingEventArgs.cs
- ScrollableControl.cs
- CompilerError.cs
- NumberSubstitution.cs
- StyleSheetRefUrlEditor.cs
- Overlapped.cs
- TableCellsCollectionEditor.cs
- Win32KeyboardDevice.cs
- SafeHandles.cs
- ContextMenu.cs
- CfgSemanticTag.cs
- HtmlContainerControl.cs
- FieldTemplateFactory.cs
- ConvertTextFrag.cs
- Point4D.cs
- HtmlTable.cs
- GridLength.cs
- BlurBitmapEffect.cs
- CustomSignedXml.cs
- OpCellTreeNode.cs
- ThrowHelper.cs
- ConfigurationSectionGroupCollection.cs
- ReferencedAssembly.cs
- PowerModeChangedEventArgs.cs
- ObjectManager.cs
- DrawListViewSubItemEventArgs.cs
- DataGridParentRows.cs
- GridView.cs
- SessionIDManager.cs
- ObjectDataSourceMethodEventArgs.cs
- ToolStripItemEventArgs.cs
- wmiprovider.cs
- DateTimeConverter.cs
- RegexCode.cs
- ContainerParaClient.cs
- ProjectionCamera.cs
- AttachedAnnotation.cs
- TiffBitmapDecoder.cs
- CatalogPart.cs
- SqlInternalConnection.cs
- cookieexception.cs
- Regex.cs
- PeerNameRegistration.cs
- _NetworkingPerfCounters.cs
- DataSourceSerializationException.cs
- MergeFilterQuery.cs
- OleDbTransaction.cs
- References.cs
- ProxyFragment.cs
- ValidationEventArgs.cs
- PartialList.cs
- TableSectionStyle.cs
- Rule.cs
- SortedDictionary.cs
- XamlGridLengthSerializer.cs
- ListViewDataItem.cs
- ColumnTypeConverter.cs
- DescriptionAttribute.cs
- DateTimeOffset.cs
- MultiPropertyDescriptorGridEntry.cs
- RawStylusInputCustomDataList.cs