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
- Missing.cs
- InkCanvasAutomationPeer.cs
- PostBackOptions.cs
- HMACSHA1.cs
- NumericPagerField.cs
- Icon.cs
- VariableAction.cs
- ReadOnlyDictionary.cs
- TransformerInfo.cs
- XmlUtil.cs
- AsynchronousChannel.cs
- ErrorHandler.cs
- MenuAutomationPeer.cs
- PersistenceContextEnlistment.cs
- MyContact.cs
- ToolBar.cs
- TextTreeRootNode.cs
- SQLInt32Storage.cs
- SurrogateSelector.cs
- CodeTypeReferenceExpression.cs
- SurrogateSelector.cs
- VoiceSynthesis.cs
- LoadedEvent.cs
- TreeNodeStyle.cs
- WCFModelStrings.Designer.cs
- TextBoxAutoCompleteSourceConverter.cs
- WindowsRebar.cs
- FormatVersion.cs
- UnsafeNativeMethods.cs
- DataGridViewUtilities.cs
- TcpProcessProtocolHandler.cs
- Vector3DAnimation.cs
- BitmapEffect.cs
- OleDbParameterCollection.cs
- SpecialFolderEnumConverter.cs
- StringComparer.cs
- util.cs
- EnumerableRowCollection.cs
- InvokePattern.cs
- AssociationEndMember.cs
- VisualStyleRenderer.cs
- TextTreeTextBlock.cs
- TemplatedAdorner.cs
- XmlCustomFormatter.cs
- RenderCapability.cs
- KeyTimeConverter.cs
- Timeline.cs
- WebGetAttribute.cs
- PartialCachingAttribute.cs
- Automation.cs
- Base64Stream.cs
- _StreamFramer.cs
- TextReturnReader.cs
- XmlImplementation.cs
- UriScheme.cs
- ScriptMethodAttribute.cs
- WriteFileContext.cs
- WebReferenceOptions.cs
- TextParaLineResult.cs
- RegexStringValidator.cs
- HtmlInputButton.cs
- XmlSecureResolver.cs
- HtmlTableRowCollection.cs
- DataGridViewElement.cs
- RepeaterItemCollection.cs
- XmlSchemaAppInfo.cs
- arabicshape.cs
- WebServiceFault.cs
- Internal.cs
- SerializerWriterEventHandlers.cs
- Currency.cs
- WebPartHeaderCloseVerb.cs
- Emitter.cs
- ConfigurationManagerInternalFactory.cs
- _SpnDictionary.cs
- log.cs
- ObjectPersistData.cs
- ItemCheckedEvent.cs
- TitleStyle.cs
- MetabaseReader.cs
- TypedElement.cs
- WebPartConnectVerb.cs
- ToolStripMenuItem.cs
- CompositeDataBoundControl.cs
- SoapHeader.cs
- XmlIlGenerator.cs
- GlyphsSerializer.cs
- AutomationPeer.cs
- LayoutDump.cs
- dbenumerator.cs
- ADMembershipUser.cs
- RegistryKey.cs
- KernelTypeValidation.cs
- DataGridViewLayoutData.cs
- KeySplineConverter.cs
- CodeIterationStatement.cs
- isolationinterop.cs
- SoapCommonClasses.cs
- AvtEvent.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs