Exemple #1
0
        public override void Start(NamedId who)
        {
            base.Start(who);

            if (_form == null)
            {
                _form             = new FormTextLogList();
                _form.FormClosed += (s, e) =>
                {
                    _form.Dispose();
                    _form = null;
                };
                foreach (var fc in AudioFeatures())
                {
                    _form.DisplayNames[fc.ID] = fc.DisplayName;
                }
                _form.Show();
            }
            else
            {
                _form.Visible     = true;
                _form.WindowState = FormWindowState.Normal;
            }
            var talks = GetUnits();

            if (talks != null)
            {
                _form.SetTextData(talks.OrderBy(a => a.TimeGenerated));
            }
            else
            {
                LOG.WriteMesLine("FeatureTextLogList", "ConfrictError");
            }
        }
Exemple #2
0
 /// <summary>
 /// Trueかどうか判断する
 /// </summary>
 /// <param name="condition"></param>
 /// <param name="meskey"></param>
 /// <param name="mesver"></param>
 /// <param name="param"></param>
 public static void IsTrue(bool condition, string meskey, string mesver, params object[] param)
 {
     if (condition == false)
     {
         LOG.WriteMesLine(meskey, mesver, param);
         throw new TestFailureException("Boolean check error");
     }
 }
Exemple #3
0
 public static void AreLessOrEqual <T>(T a, T b, string meskey, string mesver, params object[] param) where T : IComparable <T>
 {
     if (a.CompareTo(b) > 0)
     {
         LOG.WriteMesLine(meskey, mesver, param);
         throw new TestFailureException(string.Format("Not Less or Equals {0} to {1}", a.ToString(), b.ToString()));
     }
 }
Exemple #4
0
 /// <summary>
 /// 一致判定
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <param name="meskey"></param>
 /// <param name="mesver"></param>
 /// <param name="param"></param>
 public static void AreEqual <T>(T a, T b, string meskey, string mesver, params object[] param)
 {
     if (a.Equals(b) == false)
     {
         LOG.WriteMesLine(meskey, mesver, param);
         throw new TestFailureException(string.Format("Not Equals {0} to {1}", a.ToString(), b.ToString()));
     }
 }
Exemple #5
0
        private async Task <bool> SelectAudioDeviceAsync(SpeechHandler handler)
        {
            // SELECT A AUDIO DEVICE
            var devices = GetDeviceEndpoints();

            foreach (var device in devices)
            {
                if (device.ID == GetTargetDeviceID())
                {
                    handler.Device = device;
                    LOG.WriteMesLine(GetType().Name, "DeviceInitialized", device.FriendlyName);
                    return(true);
                }
            }
            LOG.WriteMesLine(GetType().Name, "NoDeviceID", Hot.Setting.Device2ID);
            await Task.Delay(20);

            return(false);
        }