コード例 #1
0
        /// <summary>
        /// Creates a new instance of the <see cref="OptimusMini" /> class and returns it.
        /// </summary>
        public OptimusMiniController()
        {
            _KeyState    = new OptimusMiniKeyState[3];
            _LastImage   = new Bitmap[3];
            _Connection  = new OptimusMiniConnection();
            _Brightness  = OptimusMiniBrightness.Low;
            _Orientation = OptimusMiniOrientation.Right;
            _Gamma       = 0.65f;
            _IdleTime    = 300;

            SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(PowerModeChanged);
        }
コード例 #2
0
 public ConfigurationController(ConfigurationManager owner, XmlElement node)
     : base(owner, node)
 {
     // Default values
       _IdleTime = 300;
       _Brightness = OptimusMiniBrightness.Low;
       _Gamma = 0.65f;
       _Orientation = OptimusMiniOrientation.Right;
       _RotationInterval = 30;
       _PluginsGetAhead = true;
       _PreferredBackgroundColor = Color.Black;
       _PreferredTextColor = Color.White;
       _PreferredTitleColor = Color.CadetBlue;
 }
コード例 #3
0
 public ConfigurationController(ConfigurationManager owner, XmlElement node)
     : base(owner, node)
 {
     // Default values
     _IdleTime                 = 300;
     _Brightness               = OptimusMiniBrightness.Low;
     _Gamma                    = 0.65f;
     _Orientation              = OptimusMiniOrientation.Right;
     _RotationInterval         = 30;
     _PluginsGetAhead          = true;
     _PreferredBackgroundColor = Color.Black;
     _PreferredTextColor       = Color.White;
     _PreferredTitleColor      = Color.CadetBlue;
 }
コード例 #4
0
        /// <summary>
        /// Creates a new instance of the <see cref="OptimusMini" /> class and returns it.
        /// </summary>
        public OptimusMiniController()
        {
            _Plugins = new OptimusMiniPluginWorkerBase[3];

            _KeyState    = new OptimusMiniKeyState[3];
            _KeyState[0] = new OptimusMiniKeyState(this, 0);
            _KeyState[1] = new OptimusMiniKeyState(this, 1);
            _KeyState[2] = new OptimusMiniKeyState(this, 2);

            _LastImage = new Bitmap[3];

            _Connection = new OptimusMiniConnection();

            _Brightness = OptimusMiniBrightness.Low;
            _Layout     = OptimusMiniLayout.Right;
            _Gamma      = 0.65f;
            _IdleTime   = 300;

            //SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(PowerModeChanged);
        }
コード例 #5
0
        private static void EnqueueBrightnessCommand(OptimusMiniBrightness brightness, Queue <byte[]> queue)
        {
            byte[] lCommand = new byte[COMMAND_LENGTH];
            lCommand[0] = 9;

            switch (brightness)
            {
            case OptimusMiniBrightness.Low:
                lCommand[1] = 20;
                break;

            case OptimusMiniBrightness.Normal:
                lCommand[1] = 40;
                break;

            case OptimusMiniBrightness.High:
                lCommand[1] = 60;
                break;
            }

            lCommand[COMMAND_LENGTH - 1] = (byte)(lCommand[0] + lCommand[1]);
            queue.Enqueue(lCommand);
        }
コード例 #6
0
 /// <summary>
 /// Sets brightness level of device.
 /// </summary>
 /// <param name="brightness">Brightness to set.</param>
 /// <returns>0 if successful, otherwise an error code.</returns>
 public int SetBrightness(OptimusMiniBrightness brightness)
 {
     _Connection.SetBrightness(brightness);
     _Brightness = brightness;
     return(0);
 }
コード例 #7
0
        private static void EnqueueBrightnessCommand(OptimusMiniBrightness brightness, Queue<byte[]> queue)
        {
            byte[] lCommand = new byte[COMMAND_LENGTH];
              lCommand[0] = 9;

              switch (brightness)
              {
            case OptimusMiniBrightness.Low:
              lCommand[1] = 20;
              break;
            case OptimusMiniBrightness.Normal:
              lCommand[1] = 40;
              break;
            case OptimusMiniBrightness.High:
              lCommand[1] = 60;
              break;
              }

              lCommand[COMMAND_LENGTH - 1] = (byte)(lCommand[0] + lCommand[1]);
              queue.Enqueue(lCommand);
        }
コード例 #8
0
 /// <summary>
 /// Sets brightness.
 /// </summary>
 public void SetBrightness(OptimusMiniBrightness brightness)
 {
     _CommandBrightnessValue = brightness;
       _CommandBrightness = true;
 }
コード例 #9
0
 /// <summary>
 /// Sets brightness.
 /// </summary>
 public void SetBrightness(OptimusMiniBrightness brightness)
 {
     _CommandBrightnessValue = brightness;
     _CommandBrightness      = true;
 }