public override void Update()
        {
            if (!Settings.IsEnabled)
            {
                return;
            }

            var dataModel = (OverlayProfileDataModel)DataModel;

            dataModel.Keyboard.NumLock    = ((ushort)GeneralProfileModel.GetKeyState(0x90) & 0xffff) != 0;
            dataModel.Keyboard.CapsLock   = ((ushort)GeneralProfileModel.GetKeyState(0x14) & 0xffff) != 0;
            dataModel.Keyboard.ScrollLock = ((ushort)GeneralProfileModel.GetKeyState(0x91) & 0xffff) != 0;

            if (_endPointVolume != null)
            {
                dataModel.Audio.Volume = _endPointVolume.GetMasterVolumeLevelScalar();
            }
        }
示例#2
0
        public void ProfilingUpdate()
        {
            using (var context = new TestContext(GetConnection()))
            {
                var entity = new GeneralProfileModel
                {
                    Name = "ProfilingUpdate",
                };
                context.GeneralProfiling.Add(entity);
                context.GeneralProfiling.SaveChanges();

                var profiler = SEProfiling.MiniProfiler.StartNew();

                entity.Name = "ProfilingUpdate-Updated";
                context.GeneralProfiling.SaveChanges();

                Assert.IsTrue(profiler.Root.CustomTimings.ContainsKey("mongodb"));
                var timings = profiler.Root.CustomTimings["mongodb"];
                Assert.IsTrue(timings[0].CommandString.Contains("UpdateOne"));
                Assert.IsTrue(timings[0].CommandString.Contains("ProfilingUpdate-Updated"));
            }
        }