public static void OnActivityMesg(object sender, MesgEventArgs e) { ActivityValues values = new ActivityValues(); ActivityMesg mesg = (ActivityMesg)e.mesg; try { values._totalTimerTime = mesg.GetTotalTimerTime(); values._numSessions = mesg.GetNumSessions(); values._type = mesg.GetType(); values._actiEvent = mesg.GetEvent(); values._eventType = mesg.GetEventType(); uint?localTimeStamp = mesg.GetLocalTimestamp(); if (localTimeStamp != null) { values._localTimestamp = FitConvert.ToDateTime(((uint)localTimeStamp)); } //Make sure properties with sub properties arent null before trying to create objects based on them if (mesg.GetTimestamp() != null) { //values.timestamp = new Dynastream.Fit.DateTime(mesg.GetTimestamp().GetTimeStamp()); uint tc = (uint)mesg.GetTimestamp().GetTimeStamp(); values._timestamp = FitConvert.ToLocalDateTime(mesg.GetTimestamp().GetTimeStamp()); } } catch (FitException exception) { Console.WriteLine("\tOnFileIDMesg Error {0}", exception.Message); Console.WriteLine("\t{0}", exception.InnerException); } DataManager.Instance.ActivityValues.Add(values); }
private void ClearAdditionalValues() { WahooFF00Values.Clear(); WahooFF01Values.Clear(); ActivityValues.Clear(); FileIdValues.Clear(); DeviceInfoValues.Clear(); WorkoutValues.Clear(); FieldDescriptionValues.Clear(); DeveloperDataIdValues.Clear(); EventValues.Clear(); SportValues.Clear(); }