예제 #1
0
        internal static EventData CreateLiveWithResend(MTA mta, DateTime beginTime)
        {
            if (beginTime.Kind != DateTimeKind.Utc)
            {
                throw new MylapsException("Begin time for interval should always be given in UTC, not local or unspecified time.");
            }
            var mtaNow = mta.GetUTCTime();
            var time   = SDKHelperFunctions.DateTimeToTimestamp(beginTime);

            var nativeHandle = NativeMethods.mta_eventdata_handle_alloc_live_with_resend(mta.NativeHandle, time, IntPtr.Zero);

            if (nativeHandle == IntPtr.Zero)
            {
                throw new MylapsSDK.Exceptions.MylapsException("Unable to allocate new event data handle");
            }
            return(new EventData(mta, nativeHandle));
        }
예제 #2
0
 public DateTime GetUTCTimeAsDateTime()
 {
     return(SDKHelperFunctions.TimestampToDateTime(GetUTCTime(), DateTimeKind.Utc));
 }
예제 #3
0
        public DateTime GetLocalTimeAsDateTime()
        {
            long localNow = GetLocalTime(GetUTCTime());

            return(SDKHelperFunctions.TimestampToDateTime(localNow, DateTimeKind.Local));
        }