Пример #1
0
        public void Init(
            PluginManager pluginManager,
            OptimusMiniPluginBrowser pluginBrowser,
            OptimusMiniSettings settings)
        {
            _PluginManager = pluginManager;
              _Browser = pluginBrowser;
              _Settings = settings;

              // ----- Available plugins
              listAvailablePlugins.Items.Clear();
              for (int i = 0; i < _Browser.Count; i++)
              {
            listAvailablePlugins.Items.Add(_Browser[i].Name);
              }
              if (_Browser.Count > 0)
              {
            listAvailablePlugins.Items[0].Selected = true;
              }

              // ----- Available layouts
              // TODO: available layouts
              listLayouts.Items.Clear();
              listLayouts.Items.Add("Default");
              listLayouts.Items[0].Selected = true;

              // ----- Update actions
              UpdateActions();
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();

              _Device = new OptimusMiniController();
              _Plugins = new OptimusMiniPluginBrowser();
              _Settings = new OptimusMiniSettings();
              _Device.SetPluginManager(new Toolz.OptimusMini.Plugins.PluginManager(_Device));

              _ConnectionStateChanged = new ConnectionStateChangedDelegate(ConnectionStateChangedMethod);
              _Device.OnConnectionStateChanged += ConnectionStateChangedEventHandler;

              _KeyDown = new KeyEventDelegate(KeyDownMethod);
              _Device.OnKeyDown += KeyDownEventHandler;

              _KeyUp = new KeyEventDelegate(KeyUpMethod);
              _Device.OnKeyUp += KeyUpEventHandler;

              _KeyHold = new KeyEventDelegate(KeyHoldMethod);
              _Device.OnKeyHold += KeyHoldEventHandler;

              _KeyRelease = new KeyEventDelegate(KeyReleaseMethod);
              _Device.OnKeyRelease += KeyReleaseEventHandler;

              _KeyPress = new KeyEventDelegate(KeyPressMethod);
              _Device.OnKeyPress += KeyPressEventHandler;

              _KeyDoublePress = new KeyEventDelegate(KeyDoublePressMethod);
              _Device.OnKeyDoublePress += KeyDoublePressEventHandler;

              selectPlugin0.Items.Add("");
              selectPlugin1.Items.Add("");
              selectPlugin2.Items.Add("");

              for (int i = 0; i < _Plugins.Count; i++)
              {
            selectPlugin0.Items.Add(_Plugins[i].Name);
            selectPlugin1.Items.Add(_Plugins[i].Name);
            selectPlugin2.Items.Add(_Plugins[i].Name);
            selectPluginToAdd.Items.Add(_Plugins[i].Name);
              }

              LoadSettings();

              new Forms.Main().Show();
        }