Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Channels / SynchronizedRandom.cs / 1305376 / SynchronizedRandom.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Channels { using System; class SynchronizedRandom : Random { public SynchronizedRandom() : base() { this.ThisLock = new object(); } public SynchronizedRandom(int seed) : base(seed) { this.ThisLock = new object(); } protected object ThisLock { get; private set; } public override int Next(int minValue, int maxValue) { lock (this.ThisLock) { return base.Next(minValue, maxValue); } } public override int Next() { lock (this.ThisLock) { return base.Next(); } } public override int Next(int maxValue) { lock (this.ThisLock) { return base.Next(maxValue); } } public override void NextBytes(byte[] buffer) { lock (this.ThisLock) { base.NextBytes(buffer); } } public override double NextDouble() { lock (this.ThisLock) { return base.NextDouble(); } } protected override double Sample() { lock (this.ThisLock) { return base.Sample(); } } } } // 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
- XmlNullResolver.cs
- SelectionItemPattern.cs
- HandleCollector.cs
- AssertFilter.cs
- EntityDesignPluralizationHandler.cs
- SecurityDescriptor.cs
- SqlClientMetaDataCollectionNames.cs
- ProcessThreadCollection.cs
- ListBox.cs
- DataGridViewHitTestInfo.cs
- SingleSelectRootGridEntry.cs
- SelectorAutomationPeer.cs
- CodeVariableReferenceExpression.cs
- TypeBuilderInstantiation.cs
- TableProviderWrapper.cs
- FacetDescriptionElement.cs
- InboundActivityHelper.cs
- TogglePattern.cs
- String.cs
- SynchronizedDispatch.cs
- XsltArgumentList.cs
- IisTraceWebEventProvider.cs
- WebDescriptionAttribute.cs
- FormsAuthentication.cs
- XmlSigningNodeWriter.cs
- AssertUtility.cs
- DataPointer.cs
- BuildResultCache.cs
- ListViewPagedDataSource.cs
- SQLDateTimeStorage.cs
- ListViewHitTestInfo.cs
- ParameterBuilder.cs
- Pick.cs
- DataSourceSerializationException.cs
- cookieexception.cs
- XmlWriterSettings.cs
- RegisteredDisposeScript.cs
- EntityDataSourceContextDisposingEventArgs.cs
- PathData.cs
- DataBoundControl.cs
- DBNull.cs
- ActivityTypeResolver.xaml.cs
- IFlowDocumentViewer.cs
- UITypeEditor.cs
- NotificationContext.cs
- PointAnimation.cs
- LoadRetryConstantStrategy.cs
- DefaultProxySection.cs
- GuidConverter.cs
- MessagePartDescriptionCollection.cs
- SynchronizationContext.cs
- DbConnectionPoolGroupProviderInfo.cs
- DecimalStorage.cs
- LayoutEditorPart.cs
- ZoneLinkButton.cs
- TextParagraph.cs
- precedingsibling.cs
- FlatButtonAppearance.cs
- CustomSignedXml.cs
- EncoderParameters.cs
- EpmCustomContentSerializer.cs
- Validator.cs
- HttpWriter.cs
- SqlReorderer.cs
- FileSystemWatcher.cs
- ConstructorBuilder.cs
- WebPartZoneCollection.cs
- GridViewRowPresenterBase.cs
- LinqDataSourceValidationException.cs
- MemberHolder.cs
- InplaceBitmapMetadataWriter.cs
- Variant.cs
- XPathMultyIterator.cs
- GPPOINTF.cs
- OneToOneMappingSerializer.cs
- RepeaterItemEventArgs.cs
- ValidatedMobileControlConverter.cs
- LayoutEvent.cs
- RelationalExpressions.cs
- ApplicationTrust.cs
- DataListItem.cs
- TextModifier.cs
- TextBox.cs
- EdgeProfileValidation.cs
- SymLanguageType.cs
- FtpWebResponse.cs
- GridViewSelectEventArgs.cs
- SqlDataReaderSmi.cs
- TransformConverter.cs
- XmlSchemaAnnotation.cs
- Font.cs
- WaitForChangedResult.cs
- CloudCollection.cs
- AppLevelCompilationSectionCache.cs
- SkewTransform.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- MimePart.cs
- ValidatingReaderNodeData.cs
- Point3DKeyFrameCollection.cs
- RegexBoyerMoore.cs