private void InitializeMappingControl(List <NameDisplayName> sourceList, List <NameDisplayName> targetList)
        {
            foreach (NameDisplayName item in sourceList)
            {
                KeyMappingControl.SourceList.Add(new ListViewItem()
                {
                    Content = item.Name, ToolTip = item.DisplayName
                });
            }

            foreach (NameDisplayName item in targetList)
            {
                KeyMappingControl.TargetList.Add(new ListViewItem()
                {
                    Content = item.Name, ToolTip = item.DisplayName
                });
            }

            KeyMappingControl.Mapping = this.relationMappingConfiguration.Mapping;

            KeyMappingControl.RedrawLines();
        }
Ejemplo n.º 2
0
        private void Configure()
        {
            this.licensesMenuItem   = this.FindControl <MenuItem>("licensesMenuItem");
            licensesMenuItem.Click += (async(s, e) =>
            {
                var window = new LicenseWindow();
                await window.ShowDialog(this);
            });
            this.scanMenuItem   = this.FindControl <MenuItem>("scanMenuItem");
            scanMenuItem.Click += (s, e) => { LookForDevices(); };

            ConnectedDevices            = new ObservableCollection <RoxyDevice>();
            this.boardGrid              = this.FindControl <DataGrid>("boardGrid");
            boardGrid.DataContext       = this;
            boardGrid.SelectionChanged += BoardGrid_SelectionChanged;

            this.tabControl = this.FindControl <TabControl>("tabControl");

            this.loadElfButton     = this.FindControl <Button>("loadElfButton");
            loadElfButton.Click   += LoadElfFile;
            this.getLatestButton   = this.FindControl <Button>("getLatestButton");
            getLatestButton.Click += GetLatestFirmware;
            this.elfFilenameText   = this.FindControl <TextBlock>("elfFilenameText");
            this.flashElfButton    = this.FindControl <Button>("flashElfButton");
            flashElfButton.Click  += FlashElfButton;

            this.consoleText      = this.FindControl <TextBlock>("consoleText");
            this.consoleContainer = this.FindControl <Border>("consoleContainer");

            this.configTab = this.FindControl <Grid>("configTab");

            this.configButtons       = this.FindControl <Grid>("configButtons");
            this.readConfigButton    = this.FindControl <Button>("readConfigButton");
            readConfigButton.Click  += ReadConfigButton_Click;
            this.writeConfigButton   = this.FindControl <Button>("writeConfigButton");
            writeConfigButton.Click += WriteConfigButton_Click;

            this.configPanel             = this.FindControl <ConfigPanel>("configPanel");
            configPanel.SubPanelChanged += SubPanelChanged;

            this.rgbControl      = this.FindControl <HueColorSliderControl>("rgbControl");
            rgbControl.OnClosed += rgbControl_Closed;
            this.rgbScrollViewer = this.FindControl <ScrollViewer>("rgbScrollViewer");

            this.keyMappingControl      = this.FindControl <KeyMappingControl>("keyMappingControl");
            keyMappingControl.OnClosed += configControl_Closed;
            this.keyMappingScrollViewer = this.FindControl <ScrollViewer>("keyMappingScrollViewer");

            this.buttonLedControl      = this.FindControl <ButtonLedControl>("buttonLedControl");
            buttonLedControl.OnClosed += configControl_Closed;
            this.buttonLedScrollViewer = this.FindControl <ScrollViewer>("buttonLedScrollViewer");

            this.deviceControl      = this.FindControl <DeviceControl>("deviceControl");
            deviceControl.OnClosed += configControl_Closed;
            this.deviceScrollViewer = this.FindControl <ScrollViewer>("deviceScrollViewer");

            this.joystickMappingControl      = this.FindControl <JoystickMappingControl>("joystickMappingControl");
            joystickMappingControl.OnClosed += configControl_Closed;
            this.joystickMappingScrollViewer = this.FindControl <ScrollViewer>("joystickMappingScrollViewer");

            this.ttControl      = this.FindControl <TurntableControl>("ttControl");
            ttControl.OnClosed += configControl_Closed;
            this.ttScrollViewer = this.Find <ScrollViewer>("ttScrollViewer");

            this.argbControl      = this.FindControl <ArgbControl>("argbControl");
            argbControl.OnClosed += configControl_Closed;
            this.argbScrollViewer = this.Find <ScrollViewer>("argbScrollViewer");

            var svre9left = this.FindControl <Button>("svre9Left");

            svre9left.Click += ((s, e) =>
            {
                SendCommand(1, 0);
            });
            var svre9right = this.FindControl <Button>("svre9Right");

            svre9right.Click += ((s, e) =>
            {
                SendCommand(1, 1);
            });

            flashElfEvent += flashElf;

            RoxyDevice.StatusWrite = delegate(string status)
            {
                StatusWrite(status);
            };

            devList          = DeviceList.Local;
            devList.Changed += DevList_Changed;
            LookForDevices();
        }