/// <summary> /// カスタム以外のチェックボックスを外します。 /// </summary> /// <param name="sender">操作チェックボックス</param> /// <param name="e">空イベントオブジェクト</param> private void checkCustom_CheckedChanged(object sender, EventArgs e) { if (checkCustom.Checked) { checkedCondition[(int)CheckedConditionType.AroundImpact] = true; checkAll.Checked = false; checkNumeric.Checked = false; checkAlpha.Checked = false; checkSign.Checked = false; acceptsCharType |= (AcceptsCharType)checkCustom.Tag; checkedCondition[(int)CheckedConditionType.AroundImpact] = false; } else { acceptsCharType &= ~(AcceptsCharType)checkCustom.Tag; } }
/// <summary> /// ApprovalCharControl クラスの新しいインスタンスを初期化します。 /// </summary> /// <param name="approvalCharacters">許可文字。</param> internal AcceptsCharControl(AcceptsCharType approvalCharacters) : this() { ApprovalCharacters = approvalCharacters; }
/// <summary> /// 半角/全角チェックボックスが操作された際に、全体設定及び、 /// 個別種類設定のチェックボックスの状態を変化させます。 /// </summary> /// <param name="sender">操作チェックボックス</param> /// <param name="e">空イベントオブジェクト</param> private void checkTypeParcelling_CheckedChanged(object sender, EventArgs e) { // 対象チェックボックスと状態列挙を決定 CheckBox focusCheckBox = (CheckBox)sender; CheckBox targetCheckBox = null; CheckBox targetHalfCheckBox = null; CheckBox targetFullCheckBox = null; CheckedConditionType conditionType = CheckedConditionType.NumericEitherChecked; if (focusCheckBox == checkHalfNumeric || focusCheckBox == checkFullNumeric) { targetCheckBox = checkNumeric; targetHalfCheckBox = checkHalfNumeric; targetFullCheckBox = checkFullNumeric; conditionType = CheckedConditionType.NumericEitherChecked; } if (focusCheckBox == checkHalfAlpha || focusCheckBox == checkFullAlpha) { targetCheckBox = checkAlpha; targetHalfCheckBox = checkHalfAlpha; targetFullCheckBox = checkFullAlpha; conditionType = CheckedConditionType.AlphaEitherChecked; } if (focusCheckBox == checkHalfSign || focusCheckBox == checkFullSign) { targetCheckBox = checkSign; targetHalfCheckBox = checkHalfSign; targetFullCheckBox = checkFullSign; conditionType = CheckedConditionType.SignEitherChecked; } // 半角/全角チェックボックスが操作された時 if (!checkedCondition[(int)CheckedConditionType.AroundImpact]) { checkAll.Checked = false; checkCustom.Checked = false; } // 半角/全角の両方がチェックされた時 if (targetHalfCheckBox.Checked && targetFullCheckBox.Checked) { checkedCondition[(int)conditionType] = false; acceptsCharType |= (AcceptsCharType)targetHalfCheckBox.Tag; acceptsCharType |= (AcceptsCharType)targetFullCheckBox.Tag; targetCheckBox.CheckState = CheckState.Checked; } // 半角/全角のいずれかがチェックされた時 else if (targetHalfCheckBox.Checked || targetFullCheckBox.Checked) { checkedCondition[(int)conditionType] = true; if (targetHalfCheckBox.Checked) { acceptsCharType |= (AcceptsCharType)targetHalfCheckBox.Tag; } else { acceptsCharType &= ~(AcceptsCharType)targetHalfCheckBox.Tag; } { } if (targetFullCheckBox.Checked) { acceptsCharType |= (AcceptsCharType)targetFullCheckBox.Tag; } else { acceptsCharType &= ~(AcceptsCharType)targetFullCheckBox.Tag; } targetCheckBox.CheckState = CheckState.Indeterminate; } // 半角/全角の両方のチェックが外された時 else { checkedCondition[(int)conditionType] = false; acceptsCharType &= ~(AcceptsCharType)targetHalfCheckBox.Tag; acceptsCharType &= ~(AcceptsCharType)targetFullCheckBox.Tag; targetCheckBox.CheckState = CheckState.Unchecked; } }