本文整理匯總了C#中System.Guid.Pack方法的典型用法代碼示例。如果您正苦於以下問題:C# Guid.Pack方法的具體用法?C# Guid.Pack怎麽用?C# Guid.Pack使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Guid
的用法示例。
在下文中一共展示了Guid.Pack方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Test
public void Test()
{
Guid g = new Guid();
string gIn = g.ToString();
string gPacked = g.Pack();
Guid gNew = gPacked.UnPackGuid();
string gOut = gNew.ToString();
Assert.IsTrue(gIn == gOut);
}
示例2: PinTag
public string PinTag(Guid roomGuid)
{
return string.Format("<dsi:object type=\"room\" ref=\"{0}\" />", roomGuid.Pack());
}
示例3: getRoomStub
RoomStub getRoomStub(Guid g, string name, string url, bool pinnable, bool guest, bool readOnly, bool pinned, bool isPhotoChatRoom, bool isPrivateChatRoom, bool isNewPhotoAlertsRoom, PresenceState presence, string icon, bool starred, int listOrder, bool isStarredByDefault, bool starrable, bool hasArchive, bool hiddenFromRoomList, bool isStreamRoom)
{
string tokenDateTimeTicks = guest ? DateTime.Now.Ticks.ToString() : "";
string token = guest ? Chat.GetToken(g, tokenDateTimeTicks) : "";
return new RoomStub(
this.ClientID,
g.Pack(),//.ToString("N"),
name,
url,
pinned,
starred,
isStarredByDefault,
pinnable,
starrable,
false,//Prefs.Current["ChatClientSelectedRoomGuid"].Exists && Prefs.Current["ChatClientSelectedRoomGuid"].Equals(g.ToString("N")),
guest,
0,
0,
"",
"",
"",
readOnly,
listOrder,
isPhotoChatRoom,
isPrivateChatRoom,
isNewPhotoAlertsRoom,
presence,
icon,
tokenDateTimeTicks,
token,
hasArchive,
hiddenFromRoomList,
isStreamRoom);
}
示例4: getLaughStub
static LaughStub getLaughStub(ItemType itemType, Guid roomGuid, Comment fullComment)
{
return new LaughStub(
Guid.NewGuid().Pack(),
itemType,
DateTime.Now.Ticks.ToString(),
roomGuid.Pack(),
Usr.Current.NickName,
Usr.Current.StmuParams,
Usr.Current.K,
Usr.Current.HasPic ? Usr.Current.Pic.ToString() : "0",
Usr.Current.HasChatPic ? Usr.Current.ChatPic.Value.ToString() : "0",
Chat.GetMessageFromCommentBody(fullComment.Text),
fullComment.Thread.GetRoomSpec().Guid.Pack(),
fullComment.UrlRefresher(),
fullComment.Thread.Subject.TruncateWithDots(50));
}
示例5: getChatMessage
static CommentMessageStub getChatMessage(Guid roomGuid, Guid pinRoomGuid, Comment newComment, Thread parentThread, Usr postingUsr, string chatMessageBody)
{
return new CommentMessageStub(
newComment.ChatItemGuid.Value.Pack(),
ItemType.CommentChatMessage,
newComment.DateTime.Ticks.ToString(),
roomGuid.Pack(),
postingUsr.NickName,
postingUsr.StmuParams,
postingUsr.K,
postingUsr.HasPic ? postingUsr.Pic.ToString() : "0",
postingUsr.HasChatPic ? postingUsr.ChatPic.Value.ToString() : "0",
chatMessageBody,
pinRoomGuid.Pack(),
newComment.UrlRefresher(),
parentThread.Subject.TruncateWithDots(30)
);
}