コード例 #1
0
        ///<summary>
        /// Retrieves the Equipment field</summary>
        /// <returns>Returns nullable WorkoutEquipment enum representing the Equipment field</returns>
        public WorkoutEquipment?GetEquipment()
        {
            object           obj   = GetFieldValue(9, 0, Fit.SubfieldIndexMainField);
            WorkoutEquipment?value = obj == null ? (WorkoutEquipment?)null : (WorkoutEquipment)obj;

            return(value);
        }
コード例 #2
0
 /// <summary>
 /// Set Equipment field</summary>
 /// <param name="equipment_">Nullable field value to be set</param>
 public void SetEquipment(WorkoutEquipment?equipment_)
 {
     SetFieldValue(9, 0, equipment_, Fit.SubfieldIndexMainField);
 }
コード例 #3
0
        private static WorkoutStepMesg CreateWorkoutStepSwim(int messageIndex, float distance, String name = null, String notes = null, Intensity intensity = Intensity.Active, SwimStroke swimStroke = SwimStroke.Invalid, WorkoutEquipment?equipment = null)
        {
            var workoutStepMesg = new WorkoutStepMesg();

            workoutStepMesg.SetMessageIndex((ushort)messageIndex);

            if (name != null)
            {
                workoutStepMesg.SetWktStepName(name);
            }

            if (notes != null)
            {
                workoutStepMesg.SetNotes(notes);
            }

            workoutStepMesg.SetIntensity(intensity);

            workoutStepMesg.SetDurationType(WktStepDuration.Distance);
            workoutStepMesg.SetDurationDistance(distance);

            workoutStepMesg.SetTargetType(WktStepTarget.SwimStroke);

            workoutStepMesg.SetTargetStrokeType((byte)swimStroke);

            if (equipment.HasValue)
            {
                workoutStepMesg.SetEquipment(equipment);
            }

            return(workoutStepMesg);
        }