public MegacoolShare(Megacool.MegacoolReceivedShareOpenedEvent e) { ReferralCode = new MegacoolReferralCode(e.userId, e.shareId); State = (MegacoolShareState)e.state; CreatedAt = FromUnixTime(e.createdAt).ToLocalTime(); UpdatedAt = FromUnixTime(e.updatedAt).ToLocalTime(); if (e.url != null) { Url = new Uri(e.url, UriKind.Relative); } if (e.dataLength > 0) { byte[] bytes = new byte[e.dataLength]; Marshal.Copy(e.dataBytes, bytes, 0, e.dataLength); DeserializeDataObject(bytes); } else { Data = new Dictionary <string, string>(); } }
public MegacoolEvent(Megacool.MegacoolReceivedShareOpenedEvent e) { Share = new MegacoolShare(e); Type = MegacoolEventType.ReceivedShareOpened; FirstSession = e.isFirstSession != 0; }