當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。