本文整理汇总了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)
);
}