チェンジセット 1652 (default、framework/trunk/WebLibrary/Sources/UI/WebControls/SelectField.cs)
- 日時:
- 2024/06/23 17:46:46 (3ヵ月前)
- ファイル:
-
- 1個の更新
凡例:
- 未変更
- 追加
- 削除
-
framework/trunk/WebLibrary/Sources/UI/WebControls/SelectField.cs
r1651 r1652 569 569 570 570 571 // FIXME Reflections に移す 572 571 573 /// <summary> 572 574 /// <see cref="RadioButtonIdSeparatorAccessor"/> フィールドの値を取得します。 … … 675 677 private static ICheckBoxControl FindCheckBoxControl(ControlCollection controls, bool visibleOnly) 676 678 { 679 bool isVisible; 680 ICheckBoxControl checkBoxControl = FindCheckBoxControl(controls, out isVisible); 681 return !visibleOnly || isVisible 682 ? checkBoxControl 683 : null; 684 } 685 686 /// <summary> 687 /// コントロールコレクションから最初に見付かった <see cref="ICheckBoxControl"/> を返します。 688 /// </summary> 689 /// <param name="controls">コントロールコレクション。</param> 690 /// <param name="isVisible"> 691 /// <see cref="ICheckBoxControl"/> が見付かった場合で表示中の場合は <see langword="true"/>。 692 /// それ以外の場合は <see langword="false"/>。 693 /// </param> 694 /// <returns> 695 /// コントロールコレクションから最初に見付かった <see cref="ICheckBoxControl"/>。 696 /// 存在しない場合は <see langword="null"/>。 697 /// </returns> 698 private static ICheckBoxControl FindCheckBoxControl(ControlCollection controls, out bool isVisible) 699 { 677 700 if (controls == null || controls.Count == 0) 678 701 { 702 isVisible = false; 679 703 return null; 680 704 } … … 682 706 foreach (Control control in controls) 683 707 { 684 // 非表示の場合は無視 685 if (visibleOnly && !control.Visible) 686 { 687 continue; 688 } 689 690 ICheckBoxControl checkBoxControl 691 = control as ICheckBoxControl 692 ?? FindCheckBoxControl(control.Controls, visibleOnly); 708 // ICheckBoxControl の場合 709 ICheckBoxControl checkBoxControl = control as ICheckBoxControl; 693 710 if (checkBoxControl != null) 694 711 { 712 isVisible = control.Visible; 695 713 return checkBoxControl; 696 714 } 697 } 698 715 716 // 子孫に ICheckBoxControl を持つ場合 717 bool childIsVisible; 718 checkBoxControl = FindCheckBoxControl(control.Controls, out childIsVisible); 719 if (checkBoxControl != null) 720 { 721 isVisible = childIsVisible && control.Visible; 722 return checkBoxControl; 723 } 724 } 725 726 isVisible = false; 699 727 return null; 700 728 }
※ 詳しい使い方は
TracChangeset を参照してください。