/// <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);
        }
 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;
 }
 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;
 }
 /// <summary>
 /// Sets orientation of device.
 /// </summary>
 /// <param name="orientation">Orientation to set.</param>
 /// <returns>0 if successful, otherwise an error code.</returns>
 public int SetOrientation(OptimusMiniOrientation orientation)
 {
     if (_Orientation != orientation)
     {
         _Orientation = orientation;
         for (byte i = 0; i <= 2; i++)
         {
             if (_LastImage[i] != null)
             {
                 Bitmap lBitmap = _LastImage[i].Clone(new Rectangle(0, 0, 96, 96), PixelFormat.Format24bppRgb);
                 RotateImage(lBitmap);
                 _Connection.SetImage(MapKeyIndex(i), lBitmap);
             }
         }
     }
     return(0);
 }