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
- NativeMethods.cs
- AxHost.cs
- ExcCanonicalXml.cs
- UnsafeMethods.cs
- SqlUDTStorage.cs
- DataSysAttribute.cs
- BaseCodeDomTreeGenerator.cs
- DeclaredTypeValidatorAttribute.cs
- BadImageFormatException.cs
- PersonalizationDictionary.cs
- ReflectTypeDescriptionProvider.cs
- GeneralTransform3DCollection.cs
- SchemaNotation.cs
- GridSplitterAutomationPeer.cs
- RuleSetBrowserDialog.cs
- ContentPlaceHolder.cs
- PtsHost.cs
- StartUpEventArgs.cs
- Simplifier.cs
- AutoGeneratedField.cs
- OnOperation.cs
- CodeObjectCreateExpression.cs
- ParallelTimeline.cs
- PreviewPageInfo.cs
- CleanUpVirtualizedItemEventArgs.cs
- DrawListViewItemEventArgs.cs
- FtpCachePolicyElement.cs
- DbProviderFactory.cs
- PixelShader.cs
- QilExpression.cs
- SkinIDTypeConverter.cs
- WorkItem.cs
- WorkflowMessageEventHandler.cs
- TextReturnReader.cs
- ParseElement.cs
- CompilerErrorCollection.cs
- DataGridViewAddColumnDialog.cs
- SqlError.cs
- SafeRightsManagementEnvironmentHandle.cs
- LabelDesigner.cs
- SettingsAttributeDictionary.cs
- WebPart.cs
- ToolStripItemTextRenderEventArgs.cs
- SizeKeyFrameCollection.cs
- RecordBuilder.cs
- Encoder.cs
- InputReport.cs
- XmlElementAttribute.cs
- EntityRecordInfo.cs
- HostProtectionPermission.cs
- TableItemStyle.cs
- SimpleFileLog.cs
- ParserContext.cs
- DataBoundControl.cs
- BigIntegerStorage.cs
- RuntimeTransactionHandle.cs
- CacheEntry.cs
- ProxyWebPartManager.cs
- GridViewSortEventArgs.cs
- SessionStateContainer.cs
- StateBag.cs
- StackBuilderSink.cs
- QilScopedVisitor.cs
- PrintPageEvent.cs
- DbCommandDefinition.cs
- COM2TypeInfoProcessor.cs
- Pens.cs
- DecoderFallbackWithFailureFlag.cs
- XmlBinaryReaderSession.cs
- ValidatorCompatibilityHelper.cs
- WindowShowOrOpenTracker.cs
- CompositeTypefaceMetrics.cs
- AttachedPropertiesService.cs
- WindowsListViewItemStartMenu.cs
- InteropDesigner.xaml.cs
- TableLayoutPanelDesigner.cs
- RelatedEnd.cs
- SHA512.cs
- DbModificationClause.cs
- StrokeCollectionDefaultValueFactory.cs
- HttpWebResponse.cs
- ServerValidateEventArgs.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- JoinSymbol.cs
- IdentityNotMappedException.cs
- DecimalStorage.cs
- ToolStripContainerActionList.cs
- TypeDescriptor.cs
- ErrorReporting.cs
- SelectionManager.cs
- DataKeyArray.cs
- ItemsPresenter.cs
- TabRenderer.cs
- Binding.cs
- WindowsGraphicsWrapper.cs
- CorruptingExceptionCommon.cs
- PrefixQName.cs
- DrawingBrush.cs
- HttpApplicationFactory.cs
- Point3DCollection.cs