Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / SecurityUniqueId.cs / 1305376 / SecurityUniqueId.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel { using System.Globalization; using System.Threading; class SecurityUniqueId { static long nextId = 0; static string commonPrefix = "uuid-" + Guid.NewGuid().ToString() + "-"; long id; string prefix; string val; SecurityUniqueId(string prefix, long id) { this.id = id; this.prefix = prefix; this.val = null; } public static SecurityUniqueId Create() { return SecurityUniqueId.Create(commonPrefix); } public static SecurityUniqueId Create(string prefix) { return new SecurityUniqueId(prefix, Interlocked.Increment(ref nextId)); } public string Value { get { if (this.val == null) this.val = this.prefix + this.id.ToString(CultureInfo.InvariantCulture); return this.val; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel { using System.Globalization; using System.Threading; class SecurityUniqueId { static long nextId = 0; static string commonPrefix = "uuid-" + Guid.NewGuid().ToString() + "-"; long id; string prefix; string val; SecurityUniqueId(string prefix, long id) { this.id = id; this.prefix = prefix; this.val = null; } public static SecurityUniqueId Create() { return SecurityUniqueId.Create(commonPrefix); } public static SecurityUniqueId Create(string prefix) { return new SecurityUniqueId(prefix, Interlocked.Increment(ref nextId)); } public string Value { get { if (this.val == null) this.val = this.prefix + this.id.ToString(CultureInfo.InvariantCulture); return this.val; } } } } // 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
- HWStack.cs
- CompositeFontParser.cs
- RtfNavigator.cs
- SQLString.cs
- ToolStripProgressBar.cs
- SoapExtensionTypeElement.cs
- ListBoxAutomationPeer.cs
- SQLByte.cs
- DependencyPropertyHelper.cs
- DataSourceXmlTextReader.cs
- DeploymentExceptionMapper.cs
- XmlAttributeCollection.cs
- KeyValueSerializer.cs
- CodeTypeMember.cs
- ConnectionManagementElement.cs
- CodeMemberField.cs
- ToolStripMenuItem.cs
- SoapConverter.cs
- ToolStripSettings.cs
- FrameworkElementAutomationPeer.cs
- StorageTypeMapping.cs
- WinEventWrap.cs
- SqlConnectionHelper.cs
- ScaleTransform.cs
- PointAnimationClockResource.cs
- ColumnWidthChangedEvent.cs
- QueryOutputWriter.cs
- CategoryAttribute.cs
- SafeViewOfFileHandle.cs
- StreamResourceInfo.cs
- XmlWrappingReader.cs
- HtmlFormParameterWriter.cs
- WindowsTokenRoleProvider.cs
- FileRecordSequenceCompletedAsyncResult.cs
- RowTypePropertyElement.cs
- Console.cs
- ServerType.cs
- RuntimeIdentifierPropertyAttribute.cs
- isolationinterop.cs
- BuilderElements.cs
- As.cs
- ScrollChrome.cs
- ProcessModuleCollection.cs
- MimeWriter.cs
- MULTI_QI.cs
- ColumnResizeUndoUnit.cs
- OleDbWrapper.cs
- BuildProviderAppliesToAttribute.cs
- MouseBinding.cs
- ReadWriteSpinLock.cs
- SplineQuaternionKeyFrame.cs
- UnaryOperationBinder.cs
- BinaryConverter.cs
- PngBitmapDecoder.cs
- SignedXml.cs
- ThemeDirectoryCompiler.cs
- EmptyQuery.cs
- SqlInfoMessageEvent.cs
- RequiredAttributeAttribute.cs
- Int32AnimationUsingKeyFrames.cs
- ConfigUtil.cs
- DataGridViewCellEventArgs.cs
- SystemBrushes.cs
- MatrixTransform3D.cs
- SessionEndingCancelEventArgs.cs
- ConnectionPointCookie.cs
- JulianCalendar.cs
- _ListenerRequestStream.cs
- AdornerHitTestResult.cs
- LineGeometry.cs
- UniqueIdentifierService.cs
- MatrixCamera.cs
- InternalRelationshipCollection.cs
- WindowPattern.cs
- XmlTypeMapping.cs
- LicenseContext.cs
- DependencyObjectPropertyDescriptor.cs
- MessageSecurityOverTcp.cs
- ObjectDataProvider.cs
- PageContent.cs
- ZipIOCentralDirectoryBlock.cs
- AnnotationService.cs
- DeclarativeConditionsCollection.cs
- WebConvert.cs
- ScriptingJsonSerializationSection.cs
- XmlSiteMapProvider.cs
- SQLInt16.cs
- CrossAppDomainChannel.cs
- PartialArray.cs
- TabRenderer.cs
- WindowsTokenRoleProvider.cs
- DoubleLinkList.cs
- ConfigurationStrings.cs
- DecoderReplacementFallback.cs
- GPStream.cs
- NumberFormatInfo.cs
- TextCompositionEventArgs.cs
- Module.cs
- ErrorActivity.cs
- EditorPartCollection.cs