Пример #1
0
        public AddProfile(IEnumerable <DeviceFullInfo> playbacks, IEnumerable <DeviceFullInfo> recordings, SettingsForm settingsForm)
        {
            InitializeComponent();
            _settingsForm = settingsForm;
            Icon          = Resources.profile;

            _profile = new ProfileSetting();

            LocalizeForm();
            InitRecordingPlaybackComboBoxes(playbacks, recordings);
            InitBindings();
        }
Пример #2
0
        public UpsertProfileExtended(Profile profile, IEnumerable <DeviceFullInfo> playbacks, IEnumerable <DeviceFullInfo> recordings, SettingsForm settingsForm, bool editing = false)
        {
            _oldProfile     = editing ? profile : null;
            _profile        = editing ? profile.Copy() : profile;
            _settingsForm   = settingsForm;
            _editing        = editing;
            _triggerFactory = new TriggerFactory();
            InitializeComponent();

            HideTriggerComponents();

            hotKeyControl.Location = textInput.Location;

            LocalizeForm();
            Icon = Resources.profile;
            InitializeFromProfile();

            try
            {
                //Only let user on Windows 10 change the switch also default device
                //Since the feature isn't available on Windows 7
                if (Environment.OSVersion.Version.Major < 10)
                {
                    profile.AlsoSwitchDefaultDevice = true;
                    switchDefaultCheckBox.Hide();
                }
            }
            catch (Exception)
            {
                // ignored
            }

            descriptionLabel.Hide();
            triggerLabel.Hide();
            InitRecordingPlaybackComboBoxes(playbacks, recordings);
            switchDefaultCheckBox.DataBindings.Add(nameof(CheckBox.Checked), _profile, nameof(Profile.AlsoSwitchDefaultDevice), false, DataSourceUpdateMode.OnPropertyChanged);
            nameTextBox.DataBindings.Add(nameof(TextBox.Text), _profile, nameof(Profile.Name), false, DataSourceUpdateMode.OnPropertyChanged);
            notifyCheckbox.DataBindings.Add(nameof(CheckBox.Checked), _profile, nameof(Profile.NotifyOnActivation), false, DataSourceUpdateMode.OnPropertyChanged);
        }
Пример #3
0
        public AddProfile(IEnumerable <DeviceFullInfo> playbacks, IEnumerable <DeviceFullInfo> recordings, SettingsForm settingsForm)
        {
            InitializeComponent();
            _settingsForm = settingsForm;
            Icon          = Resources.profile;

            _profile = new ProfileSetting();

            LocalizeForm();
            InitRecordingPlaybackComboBoxes(playbacks, recordings);
            InitBindings();

            try
            {
                //Only let user on Windows 10 change the switch also default device
                //Since the feature isn't available on Windows 7
                if (Environment.OSVersion.Version.Major >= 10)
                {
                    programTextBox.TextChanged += programTextBox_TextChanged;
                }
            }
            catch (Exception)
            {
                programTextBox.TextChanged += programTextBox_TextChanged;
            }
        }