示例#1
0
文件: Queries.cs 项目: Limroto/ECH
        public void LogUpdateMotorEvent(Motor motor)
        {
            var log = new Settings
                {
                    Active = motor.Activated,
                    Direction = (motor.Rotation == RotationDirection.Clockwise ? "Clockwise" : "AntiClockwise"),
                    Speed = motor.Speed
                };

            using(var session = _factory.OpenSession())
            {
                using(var transaction = session.BeginTransaction())
                {
                    session.SaveOrUpdate(log);
                    transaction.Commit();
                }
            }
        }
示例#2
0
 private void UpdateMotorHandler(Motor obj)
 {
     Speed = obj.Speed;
     Activated = obj.Activated;
     Rotation = obj.Rotation;
 }
示例#3
0
 private void UpdateMotorHandler(Motor obj)
 {
     throw new System.NotImplementedException();
 }
示例#4
0
 public void ActivateMoterHandler(Motor motor)
 {
     SystemSounds.Asterisk.Play();
 }