当前位置: 首页>>代码示例>>C#>>正文


C# Guid.ToCanonicalString方法代码示例

本文整理汇总了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());
        }
开发者ID:michaellperry,项目名称:Commuter,代码行数:19,代码来源:Queue.cs

示例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);
     }
 }
开发者ID:Rustemt,项目名称:rovermob,代码行数:19,代码来源:FileMessageStore.cs

示例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;
 }
开发者ID:michaellperry,项目名称:Commuter,代码行数:22,代码来源:Functions.cs

示例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;
 }
开发者ID:michaellperry,项目名称:Commuter,代码行数:13,代码来源:Functions.cs

示例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());
     }
 }
开发者ID:Rustemt,项目名称:rovermob,代码行数:10,代码来源:FileMessageStore.cs


注:本文中的System.Guid.ToCanonicalString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。