コード例 #1
0
        public override void ResolveBreadUnitsForAddShortInsulin(AddShortInsulinIntent intent, Action <INDoubleResolutionResult> completion)
        {
            try
            {
                Console.WriteLine(intent.BreadUnits.DoubleValue);

                completion(INDoubleResolutionResult.GetSuccess(intent.BreadUnits.DoubleValue));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #2
0
        /// <inheritdoc />
        public override void ResolveLevelForAddMeasure(AddMeasureIntent intent, Action <INDoubleResolutionResult> completion)
        {
            try
            {
                Console.WriteLine(intent.Level.DoubleValue);

                completion(intent.Level.DoubleValue <= Double.Epsilon
                    ? INDoubleResolutionResult.NeedsValue
                    : INDoubleResolutionResult.GetSuccess(intent.Level.DoubleValue));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }