Example #1
0
        static void OnUserProfileMesg(object sender, MesgEventArgs e)
        {
            Console.WriteLine("UserProfileHandler: Received {1} Mesg, it has global ID#{0}", e.mesg.Num, e.mesg.Name);
            UserProfileMesg myUserProfile = (UserProfileMesg)e.mesg;

            try
            {
                Console.WriteLine("\tType {0}", myUserProfile.GetFriendlyName());
                Console.WriteLine("\tGender {0}", myUserProfile.GetGender().ToString());
                Console.WriteLine("\tAge {0}", myUserProfile.GetAge());
                Console.WriteLine("\tWeight  {0}", myUserProfile.GetWeight());
            }
            catch (FitException exception)
            {
                Console.WriteLine("\tOnUserProfileMesg Error {0}", exception.Message);
                Console.WriteLine("\t{0}", exception.InnerException);
            }
        }
Example #2
0
        void OnUserProfileMesg(object sender, MesgEventArgs e)
        {
            logger.Trace("UserProfileHandler: Received {1} Mesg, it has global ID#{0}", e.mesg.Num, e.mesg.Name);
            UserProfileMesg myUserProfile = (UserProfileMesg)e.mesg;

            try
            {
                logger.Trace("\tFriendlyName \"{0}\"", Encoding.UTF8.GetString(myUserProfile.GetFriendlyName()));
                logger.Trace("\tGender {0}", myUserProfile.GetGender().ToString());
                logger.Trace("\tAge {0}", myUserProfile.GetAge());
                logger.Trace("\tWeight  {0}", myUserProfile.GetWeight());
            }
            catch (FitException exception)
            {
                logger.Trace("\tOnUserProfileMesg Error {0}", exception.Message);
                logger.Trace("\t{0}", exception.InnerException);
            }
        }