Example #1
0
        private async Task ReleaseLightModuleAsync()
        {
            await LightModule.StopAsync();

            LightModule.Dispose();
            LightModule = null;
        }
Example #2
0
 /// <summary>
 /// 开启模拟灯光
 /// </summary>
 /// <param name="group"></param>
 /// <returns></returns>
 private async Task StartLightAsync(string group)
 {
     if (LightExamItem != null && LightExamItem.State == ExamItemState.Progressing)
     {
         await LightModule.StopAsync();
     }
     await LightModule.StartAsync(new ExamContext { ExamGroup = group });
 }
Example #3
0
        //按下一次初始化一次
        protected void InitLightModule()
        {
            LightModule   = new LightModule();
            LightExamItem = LightModule.LightExamItem;
            LightModule.InitAsync(new ExamInitializationContext(MapSet.Empty)).Wait();

            var lightGroup = dataService.AllLightExamItems;

            LightGroups = new Queue <string>();
            foreach (var item in lightGroup)
            {
                //考试完成后在继续考试
                LightGroups.Enqueue(item.GroupName);
            }
        }
 protected void InitModule()
 {
     LightModule   = new LightModule();
     LightExamItem = LightModule.LightExamItem;
     LightModule.InitAsync(new ExamInitializationContext(MapSet.Empty)).Wait();
 }