public MouseImageViewerToolPropertyComponentControl(MouseImageViewerToolPropertyComponent component)
		{
			InitializeComponent();

			_chkInitiallySelected.DataBindings.Add("Checked", component, "InitiallyActive", false, DataSourceUpdateMode.OnPropertyChanged);

			_cboActiveMouseButtons.Format += OnCboActiveMouseButtonsFormat;
			_cboActiveMouseButtons.SelectedIndexChanged += OnComboBoxSelectedItemChangedUpdate;
			_cboActiveMouseButtons.Items.Add(XMouseButtons.Left);
			_cboActiveMouseButtons.Items.Add(XMouseButtons.Right);
			_cboActiveMouseButtons.Items.Add(XMouseButtons.Middle);
			_cboActiveMouseButtons.Items.Add(XMouseButtons.XButton1);
			_cboActiveMouseButtons.Items.Add(XMouseButtons.XButton2);
			_cboActiveMouseButtons.SelectedIndex = 0;
			_cboActiveMouseButtons.DataBindings.Add("SelectedItem", component, "ActiveMouseButtons", true, DataSourceUpdateMode.OnPropertyChanged);

			_cboGlobalMouseButtons.Format += OnCboActiveMouseButtonsFormat;
			_cboGlobalMouseButtons.SelectedIndexChanged += OnComboBoxSelectedItemChangedUpdate;
			_cboGlobalMouseButtons.Items.Add(XMouseButtons.None);
			_cboGlobalMouseButtons.Items.Add(XMouseButtons.Left);
			_cboGlobalMouseButtons.Items.Add(XMouseButtons.Right);
			_cboGlobalMouseButtons.Items.Add(XMouseButtons.Middle);
			_cboGlobalMouseButtons.Items.Add(XMouseButtons.XButton1);
			_cboGlobalMouseButtons.Items.Add(XMouseButtons.XButton2);
			_cboGlobalMouseButtons.SelectedIndex = 0;
			_cboGlobalMouseButtons.DataBindings.Add("SelectedItem", component, "GlobalMouseButtons", true, DataSourceUpdateMode.OnPropertyChanged);

			Binding keyModifierBinding = new Binding("KeyModifiers", component, "GlobalModifiers", true, DataSourceUpdateMode.OnPropertyChanged);
			keyModifierBinding.Format += OnKeyModifierBindingConvert;
			keyModifierBinding.Parse += OnKeyModifierBindingConvert;
			_chkGlobalModifiers.DataBindings.Add(keyModifierBinding);
		}
Esempio n. 2
0
        public MouseImageViewerToolPropertyComponentControl(MouseImageViewerToolPropertyComponent component)
        {
            InitializeComponent();

            _chkInitiallySelected.DataBindings.Add("Checked", component, "InitiallyActive", false, DataSourceUpdateMode.OnPropertyChanged);

            _cboActiveMouseButtons.Format += OnCboActiveMouseButtonsFormat;
            _cboActiveMouseButtons.SelectedIndexChanged += OnComboBoxSelectedItemChangedUpdate;
            _cboActiveMouseButtons.Items.Add(XMouseButtons.Left);
            _cboActiveMouseButtons.Items.Add(XMouseButtons.Right);
            _cboActiveMouseButtons.Items.Add(XMouseButtons.Middle);
            _cboActiveMouseButtons.Items.Add(XMouseButtons.XButton1);
            _cboActiveMouseButtons.Items.Add(XMouseButtons.XButton2);
            _cboActiveMouseButtons.SelectedIndex = 0;
            _cboActiveMouseButtons.DataBindings.Add("SelectedItem", component, "ActiveMouseButtons", true, DataSourceUpdateMode.OnPropertyChanged);

            _cboGlobalMouseButtons.Format += OnCboActiveMouseButtonsFormat;
            _cboGlobalMouseButtons.SelectedIndexChanged += OnComboBoxSelectedItemChangedUpdate;
            _cboGlobalMouseButtons.Items.Add(XMouseButtons.None);
            _cboGlobalMouseButtons.Items.Add(XMouseButtons.Left);
            _cboGlobalMouseButtons.Items.Add(XMouseButtons.Right);
            _cboGlobalMouseButtons.Items.Add(XMouseButtons.Middle);
            _cboGlobalMouseButtons.Items.Add(XMouseButtons.XButton1);
            _cboGlobalMouseButtons.Items.Add(XMouseButtons.XButton2);
            _cboGlobalMouseButtons.SelectedIndex = 0;
            _cboGlobalMouseButtons.DataBindings.Add("SelectedItem", component, "GlobalMouseButtons", true, DataSourceUpdateMode.OnPropertyChanged);

            Binding keyModifierBinding = new Binding("KeyModifiers", component, "GlobalModifiers", true, DataSourceUpdateMode.OnPropertyChanged);

            keyModifierBinding.Format += OnKeyModifierBindingConvert;
            keyModifierBinding.Parse  += OnKeyModifierBindingConvert;
            _chkGlobalModifiers.DataBindings.Add(keyModifierBinding);
        }
		public void SetComponent(IApplicationComponent component)
		{
			_component = (MouseImageViewerToolPropertyComponent) component;
		}
 public void SetComponent(IApplicationComponent component)
 {
     _component = (MouseImageViewerToolPropertyComponent)component;
 }