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
- TextCompositionManager.cs
- TypeElement.cs
- EventMappingSettingsCollection.cs
- TypeDescriptorContext.cs
- GifBitmapEncoder.cs
- SkinBuilder.cs
- TdsParserSessionPool.cs
- DescriptionAttribute.cs
- FormViewPageEventArgs.cs
- ProcessInfo.cs
- GlobalizationSection.cs
- ServiceContractGenerator.cs
- CuspData.cs
- WSHttpBindingBaseElement.cs
- TabControl.cs
- HashSetDebugView.cs
- WindowProviderWrapper.cs
- XXXOnTypeBuilderInstantiation.cs
- AxHost.cs
- CachedPathData.cs
- HandlerWithFactory.cs
- MouseActionValueSerializer.cs
- TabRenderer.cs
- MenuStrip.cs
- UnknownWrapper.cs
- UpdateCommand.cs
- MergeFailedEvent.cs
- CodePageUtils.cs
- RuleEngine.cs
- TreeNodeEventArgs.cs
- TypeNameConverter.cs
- XamlStream.cs
- DataBoundLiteralControl.cs
- SchemaEntity.cs
- ListViewDataItem.cs
- _TLSstream.cs
- ToolStripOverflow.cs
- StringDictionaryCodeDomSerializer.cs
- ZoneMembershipCondition.cs
- NavigationProperty.cs
- NestPullup.cs
- WebRequest.cs
- AutomationAttributeInfo.cs
- SpeechUI.cs
- MaterialGroup.cs
- DataGridColumnCollection.cs
- SAPICategories.cs
- TextSpanModifier.cs
- XmlC14NWriter.cs
- FrameDimension.cs
- _SpnDictionary.cs
- NameTable.cs
- Filter.cs
- BooleanStorage.cs
- ToolboxItem.cs
- GPPOINT.cs
- BufferAllocator.cs
- UnescapedXmlDiagnosticData.cs
- GcHandle.cs
- ComplexObject.cs
- EventLogEntry.cs
- Triplet.cs
- DecodeHelper.cs
- TriggerCollection.cs
- NTAccount.cs
- ToolboxItemAttribute.cs
- Panel.cs
- IItemContainerGenerator.cs
- EdmError.cs
- PenThreadPool.cs
- TransformGroup.cs
- LogWriteRestartAreaAsyncResult.cs
- OdbcHandle.cs
- DeferredSelectedIndexReference.cs
- MappingException.cs
- ItemList.cs
- FilteredSchemaElementLookUpTable.cs
- MdImport.cs
- TargetFrameworkAttribute.cs
- LinkClickEvent.cs
- StreamInfo.cs
- HttpContext.cs
- UnsafeNativeMethods.cs
- SizeAnimationBase.cs
- RoutingTable.cs
- DbException.cs
- ArgumentFixer.cs
- ProxyWebPartConnectionCollection.cs
- ColumnTypeConverter.cs
- MemoryStream.cs
- Int32RectConverter.cs
- UnauthorizedWebPart.cs
- ToolTipService.cs
- VBIdentifierTrimConverter.cs
- DurableOperationAttribute.cs
- TemplatePagerField.cs
- MemberHolder.cs
- MultiPageTextView.cs
- RunClient.cs
- RequestCachingSection.cs