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
- HostProtectionPermission.cs
- PropertyChangingEventArgs.cs
- XmlnsDictionary.cs
- SplitContainer.cs
- FixedSOMTextRun.cs
- WorkingDirectoryEditor.cs
- ItemDragEvent.cs
- HttpException.cs
- DocumentOrderComparer.cs
- UseManagedPresentationBindingElement.cs
- WindowClosedEventArgs.cs
- ContentPlaceHolder.cs
- EntryWrittenEventArgs.cs
- SHA1CryptoServiceProvider.cs
- X509ChainElement.cs
- SerializationSectionGroup.cs
- DropTarget.cs
- Char.cs
- UseManagedPresentationElement.cs
- RadialGradientBrush.cs
- SimpleWebHandlerParser.cs
- XmlNode.cs
- IListConverters.cs
- HideDisabledControlAdapter.cs
- CompressStream.cs
- CodeObjectCreateExpression.cs
- Hash.cs
- ChannelManagerService.cs
- MultitargetUtil.cs
- TypeConverterBase.cs
- LexicalChunk.cs
- RectangleHotSpot.cs
- FacetEnabledSchemaElement.cs
- SimpleWorkerRequest.cs
- TextRunTypographyProperties.cs
- Utility.cs
- XmlSchemaObjectTable.cs
- TextDecorationCollection.cs
- ManagementObjectSearcher.cs
- RSAOAEPKeyExchangeDeformatter.cs
- DbProviderSpecificTypePropertyAttribute.cs
- TextDecorationLocationValidation.cs
- QueryConverter.cs
- ActivityStatusChangeEventArgs.cs
- SpecularMaterial.cs
- CodeMemberProperty.cs
- ReadOnlyObservableCollection.cs
- WebScriptEnablingBehavior.cs
- FixedDocumentSequencePaginator.cs
- FormViewDeleteEventArgs.cs
- WsdlBuildProvider.cs
- CustomPeerResolverService.cs
- ResourceProperty.cs
- URLIdentityPermission.cs
- FilterUserControlBase.cs
- Transform.cs
- IconBitmapDecoder.cs
- AudioException.cs
- SortFieldComparer.cs
- SecurityState.cs
- HwndTarget.cs
- ImageFormat.cs
- SiteMapNodeItemEventArgs.cs
- DesignerForm.cs
- CodeAccessSecurityEngine.cs
- CanonicalizationDriver.cs
- HtmlForm.cs
- CryptoStream.cs
- Crypto.cs
- GregorianCalendarHelper.cs
- OperationAbortedException.cs
- ValueType.cs
- DataGridTable.cs
- ConnectionStringsSection.cs
- SafeCryptHandles.cs
- ParameterModifier.cs
- _emptywebproxy.cs
- ProtocolImporter.cs
- QueryRewriter.cs
- DataGridLinkButton.cs
- FixedPageStructure.cs
- HttpCapabilitiesEvaluator.cs
- MessageHeaderInfoTraceRecord.cs
- WebPartDesigner.cs
- WindowsListViewItemCheckBox.cs
- RestHandlerFactory.cs
- Brush.cs
- MachineKeyValidationConverter.cs
- objectquery_tresulttype.cs
- PropertyGroupDescription.cs
- COM2TypeInfoProcessor.cs
- Ref.cs
- OdbcConnectionPoolProviderInfo.cs
- ProxyDataContractResolver.cs
- EndPoint.cs
- DataGridComboBoxColumn.cs
- BaseAppDomainProtocolHandler.cs
- StatementContext.cs
- SizeLimitedCache.cs
- SystemWebExtensionsSectionGroup.cs