本文整理汇总了C#中System.Guid.ToCanonicalString方法的典型用法代码示例。如果您正苦于以下问题:C# Guid.ToCanonicalString方法的具体用法?C# Guid.ToCanonicalString怎么用?C# Guid.ToCanonicalString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Guid
的用法示例。
在下文中一共展示了Guid.ToCanonicalString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Queue
public Queue(
Guid objectId,
Guid userGuid,
Uri mediaUrl,
string title,
string summary,
DateTime publishedDate,
Uri imageUri)
{
ObjectId = objectId;
_userGuid = userGuid;
MediaUrl = mediaUrl;
Title = title;
Summary = summary;
PublishedDate = publishedDate;
ImageUri = imageUri;
_playhead = new Mutable<double>(userGuid.ToCanonicalString());
}
示例2: LoadInternalAsync
private async Task LoadInternalAsync(Guid objectId, TaskCompletionSource<ImmutableList<Message>> completion)
{
try
{
string fileName = String.Format("obj_{0}.json",
objectId.ToCanonicalString());
var stream = await FileImplementation.OpenForRead(
_folderName, fileName);
var messages = ReadMessages(stream);
var result = messages
.Select(m => Message.FromMemento(m))
.ToImmutableList();
completion.SetResult(result);
}
catch (Exception ex)
{
completion.SetException(ex);
}
}
示例3: CreateSearchResultMessage
private static Message CreateSearchResultMessage(
MessageHash searchHash,
Guid searchTermId,
SearchResult searchResult)
{
var searchResultMessage = Message.CreateMessage(
searchTermId.ToCanonicalString(),
"SearchResult",
Predecessors.Set
.In("Search", searchHash),
searchTermId,
new
{
ProviderId = "digitalpodcast.com",
FeedUrl = searchResult.FeedUrl,
Title = searchResult.Title,
Subtitle = searchResult.Subtitle,
Author = searchResult.Author,
ImageUri = searchResult.ImageUri
});
return searchResultMessage;
}
示例4: CreateAggregateMessage
private static Message CreateAggregateMessage(
Guid searchTermId,
ImmutableList<Message> searchResultMessages)
{
var aggregateMessage = Message.CreateMessage(
searchTermId.ToCanonicalString(),
"Aggregate",
Predecessors.Set
.In("SearchResult", searchResultMessages.Select(r => r.Hash)),
searchTermId,
new { });
return aggregateMessage;
}
示例5: SaveUserIdentifierInternalAsync
private async Task SaveUserIdentifierInternalAsync(string role, Guid userIdentifier)
{
string fileName = String.Format("user_{0}.txt", role);
var outputStream = await FileImplementation.OpenForWrite(
_folderName, fileName);
using (var writer = new StreamWriter(outputStream))
{
await writer.WriteAsync(userIdentifier.ToCanonicalString());
}
}