コード例 #1
0
        private void clarionTextBox_TextChanged(object sender, EventArgs e)
        {
            if (!_ignoreTextFieldChange)
            {
                string clarion = clarionTextBox.Text.Trim('h', 'H', ' ');
                if (clarion.Length == 7)
                {
                    clarion = clarion.Substring(1, 6); // trim off the leading "00" or "0" that i sometimes included in clarion
                }
                if (clarion.Length == 8)
                {
                    clarion = clarion.Substring(2, 6); // trim off the leading "00" or "0" that i sometimes included in clarion
                }
                if (clarion.Length == 6)
                {
                    _changingControl = (Control)sender;
                    notifyValueChangedByUser(LeadingInputElement.ClarionInput);

                    string clarionColorInHtml = clarion.Substring(4, 2) +
                                                clarion.Substring(2, 2) +
                                                clarion.Substring(0, 2);
                    setColor(RgbColor.FromColor(ColorTranslator.FromHtml(
                                                    @"#" + clarionColorInHtml)));

                    _changingControl = null;
                }
            }
        }
コード例 #2
0
        private void clarionLongTextBox_TextChanged(object sender, EventArgs e)
        {
            if (!_ignoreTextFieldChange)
            {
                _changingControl = (Control)sender;
                notifyValueChangedByUser(LeadingInputElement.ClarionLongInput);

                setColor(RgbColor.FromColor(ColorTranslator.FromOle(Int32.Parse(clarionLongTextBox.Text))));

                _changingControl = null;
            }
        }
コード例 #3
0
        private void htmlTextBox_TextChanged(object sender, EventArgs e)
        {
            if (!_ignoreTextFieldChange)
            {
                string html = htmlTextBox.Text.Trim('#', ' ');

                if (html.Length == 6)
                {
                    _changingControl = (Control)sender;
                    notifyValueChangedByUser(LeadingInputElement.HtmlInput);

                    setColor(RgbColor.FromColor(ColorTranslator.FromHtml(
                                                    @"#" + html)));
                    _changingControl = null;
                }
            }
        }