Ejemplo n.º 1
0
        public TTSSettingsForm(MainForm mainFormReference, PrivateSettings settings)
        {
            this.VoiceSynthesizer  = settings.VoiceSynthesizer;
            this.RequiredRight     = settings.TTSRoleRequirement;
            this.CustomRewardID    = settings.TTSRewardID;
            this.TTSLogic          = settings.TTSLogic;
            this.SettingsReference = settings;
            this.mainFormReference = mainFormReference;
            InitializeComponent();
            this.AddComboboxDataSources();

            //Initialization stuff here!
            using (var synthesizer = new SpeechSynthesizer())
            {
                var voices = synthesizer.GetInstalledVoices();
                foreach (var voice in voices)
                {
                    CBox_VoiceSynthesizer.Items.Add(voice.VoiceInfo.Name);
                }
            }

            //bindings
            this.CBox_VoiceSynthesizer.DataBindings.Add("Text", this, "VoiceSynthesizer", false, DataSourceUpdateMode.OnPropertyChanged);
            this.TB_CustomRewardID.DataBindings.Add("Text", this, "CustomRewardID", false, DataSourceUpdateMode.OnPropertyChanged);
            this.CBox_RequiredRole.DataBindings.Add("SelectedValue", this, "RequiredRight", false, DataSourceUpdateMode.OnPropertyChanged);
            this.CBox_TTSLogic.DataBindings.Add("SelectedValue", this, "TTSLogic", false, DataSourceUpdateMode.OnPropertyChanged);
        }
Ejemplo n.º 2
0
        private void B_OK_Click(object sender, EventArgs e)
        {
            if (CustomRewardID == "")
            {
                MessageBox.Show("No Custom Reward Provided for TTS. Setting it to legacy method.", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.TTSLogic = Structs.TTSLogic.RewardIDAndCommand;
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }