Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ChannelManager.cs
- SessionEndingCancelEventArgs.cs
- PersistChildrenAttribute.cs
- QuestionEventArgs.cs
- EventPrivateKey.cs
- RegexRunnerFactory.cs
- MappedMetaModel.cs
- IdentifierService.cs
- ToolStripGripRenderEventArgs.cs
- XmlDeclaration.cs
- XmlSchemaAll.cs
- InvokeGenerator.cs
- ResourceCategoryAttribute.cs
- AssemblyAttributes.cs
- OdbcException.cs
- SendOperation.cs
- MemberRelationshipService.cs
- UITypeEditor.cs
- KeyGestureConverter.cs
- DynamicEndpointElement.cs
- BaseAddressElement.cs
- SchemaInfo.cs
- RightsDocument.cs
- ImageListStreamer.cs
- EntityDataSource.cs
- XmlSchemaSimpleTypeUnion.cs
- AppDomainProtocolHandler.cs
- PassportAuthentication.cs
- X509RawDataKeyIdentifierClause.cs
- ScriptReference.cs
- XmlTextWriter.cs
- Vector.cs
- PlaceHolder.cs
- SoapAttributeAttribute.cs
- TextWriter.cs
- PropertyItemInternal.cs
- PathBox.cs
- TextViewSelectionProcessor.cs
- StreamWriter.cs
- TextSerializer.cs
- ObjectReferenceStack.cs
- CompatibleIComparer.cs
- DbCommandDefinition.cs
- MessageQueueException.cs
- MsmqVerifier.cs
- ServiceNameElement.cs
- ServiceModelConfigurationElementCollection.cs
- SendMailErrorEventArgs.cs
- VisualBrush.cs
- ToolStripItemBehavior.cs
- DefaultCommandExtensionCallback.cs
- CodeVariableDeclarationStatement.cs
- TdsParserStateObject.cs
- RichTextBox.cs
- HttpApplicationStateWrapper.cs
- ValidationHelpers.cs
- SafeReversePInvokeHandle.cs
- ComPersistableTypeElementCollection.cs
- HttpCachePolicyElement.cs
- SqlInternalConnection.cs
- WpfWebRequestHelper.cs
- WebPartEventArgs.cs
- OdbcFactory.cs
- SqlClientMetaDataCollectionNames.cs
- CryptoApi.cs
- CodeIdentifier.cs
- Common.cs
- InputProviderSite.cs
- CryptoKeySecurity.cs
- Condition.cs
- X509Extension.cs
- VariableExpressionConverter.cs
- DbProviderSpecificTypePropertyAttribute.cs
- UInt16.cs
- SqlConnectionHelper.cs
- DataGridViewBand.cs
- SyndicationSerializer.cs
- FusionWrap.cs
- BindingNavigatorDesigner.cs
- HandledEventArgs.cs
- _HTTPDateParse.cs
- PersonalizationDictionary.cs
- InputMethodStateChangeEventArgs.cs
- Label.cs
- XhtmlBasicValidatorAdapter.cs
- BitmapMetadataBlob.cs
- SafeCryptContextHandle.cs
- CngKeyBlobFormat.cs
- OracleFactory.cs
- HtmlSelect.cs
- DocumentCollection.cs
- PLINQETWProvider.cs
- CallId.cs
- TextMarkerSource.cs
- BookmarkEventArgs.cs
- SafeNativeMethods.cs
- MsmqUri.cs
- GenericUI.cs
- BulletedListEventArgs.cs
- CodeGotoStatement.cs