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
- VisualStateManager.cs
- RuntimeVariableList.cs
- ActivityTypeCodeDomSerializer.cs
- XmlDocumentViewSchema.cs
- ValueProviderWrapper.cs
- WebPartTracker.cs
- RangeValueProviderWrapper.cs
- SpecialNameAttribute.cs
- CallContext.cs
- StylusButtonEventArgs.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- TextDecorationCollection.cs
- ToolStripLocationCancelEventArgs.cs
- UTF7Encoding.cs
- RelativeSource.cs
- LicenseManager.cs
- DefaultPropertyAttribute.cs
- DeploymentSection.cs
- StateRuntime.cs
- ToolStripItemCollection.cs
- WindowsPen.cs
- ReadOnlyDataSourceView.cs
- BaseTemplateCodeDomTreeGenerator.cs
- printdlgexmarshaler.cs
- AsymmetricKeyExchangeFormatter.cs
- Pts.cs
- CharEntityEncoderFallback.cs
- HyperLink.cs
- DefaultPrintController.cs
- _AutoWebProxyScriptEngine.cs
- RawUIStateInputReport.cs
- CompoundFileStorageReference.cs
- selecteditemcollection.cs
- HebrewNumber.cs
- BamlLocalizationDictionary.cs
- TextBreakpoint.cs
- DateTimeValueSerializerContext.cs
- ColumnResizeUndoUnit.cs
- MetadataSource.cs
- CoreChannel.cs
- TextControl.cs
- DataFormats.cs
- SafeRightsManagementSessionHandle.cs
- ByteArrayHelperWithString.cs
- DesignerActionHeaderItem.cs
- HttpListenerContext.cs
- CertificateReferenceElement.cs
- DockPattern.cs
- ToolStripGrip.cs
- WizardStepBase.cs
- Iis7Helper.cs
- CodeMemberProperty.cs
- CompositeActivityTypeDescriptor.cs
- WebPartDisplayModeCollection.cs
- ObjectDataSourceView.cs
- ParserHooks.cs
- CodeTypeReference.cs
- Attributes.cs
- GradientBrush.cs
- CuspData.cs
- XmlWhitespace.cs
- DynamicRenderer.cs
- PathParser.cs
- ConfigurationSchemaErrors.cs
- ExpressionBindings.cs
- ZipIOFileItemStream.cs
- ControlCollection.cs
- CorrelationTokenTypeConvertor.cs
- FileSystemEventArgs.cs
- BaseServiceProvider.cs
- ICollection.cs
- ToolStripSeparatorRenderEventArgs.cs
- ExceptionList.cs
- KeyFrames.cs
- MultiTargetingUtil.cs
- FastEncoderStatics.cs
- TimeoutValidationAttribute.cs
- GenericAuthenticationEventArgs.cs
- DocumentEventArgs.cs
- ReadOnlyAttribute.cs
- ShapingEngine.cs
- PermissionListSet.cs
- HttpChannelBindingToken.cs
- ConfigurationValue.cs
- SectionUpdates.cs
- HashJoinQueryOperatorEnumerator.cs
- XhtmlBasicLabelAdapter.cs
- FormViewModeEventArgs.cs
- DeclaredTypeElementCollection.cs
- SapiRecoInterop.cs
- PartitionedStream.cs
- DataExpression.cs
- XmlSortKeyAccumulator.cs
- ToolStripItemImageRenderEventArgs.cs
- PostBackTrigger.cs
- Rule.cs
- LinearKeyFrames.cs
- DbConnectionHelper.cs
- AccessKeyManager.cs
- GenerateScriptTypeAttribute.cs