チェンジセット 1633 (default)
- 日時:
- 2024/02/12 2:49:43 (8ヵ月前)
- 場所:
- framework/trunk
- ファイル:
-
- 5個の追加
- 6個の更新
凡例:
- 未変更
- 追加
- 削除
-
framework/trunk/WebApplication/WebApplication.csproj
r1632 r1633 71 71 <Content Include="UI\WebControls\FormViewBindUserControl1.ascx" /> 72 72 <Content Include="UI\WebControls\FormViewPage.aspx" /> 73 <Content Include="UI\WebControls\RadioButtonFieldPage.aspx" /> 73 74 <Content Include="UI\WebControls\TemplateFieldPage.aspx" /> 74 75 <Content Include="UI\WebControls\ObjectDataSourceGridViewPage.aspx" /> … … 339 340 <Compile Include="UI\Parameter\ParameterMemberPage.aspx.designer.cs"> 340 341 <DependentUpon>ParameterMemberPage.aspx</DependentUpon> 342 </Compile> 343 <Compile Include="UI\WebControls\RadioButtonFieldPage.aspx.cs"> 344 <DependentUpon>RadioButtonFieldPage.aspx</DependentUpon> 345 <SubType>ASPXCodeBehind</SubType> 346 </Compile> 347 <Compile Include="UI\WebControls\RadioButtonFieldPage.aspx.designer.cs"> 348 <DependentUpon>RadioButtonFieldPage.aspx</DependentUpon> 341 349 </Compile> 342 350 <Compile Include="UI\WebControls\TemplateFieldPage.aspx.cs"> … … 602 610 <None Include="App_Data\SqlTemplates\UI\WebControls\JQueryImageButtonFieldPage.st" /> 603 611 <None Include="App_Data\SqlTemplates\UI\WebControls\PageMemberParameterPage.st" /> 612 <Content Include="App_Data\SqlTemplates\UI\WebControls\RadioButtonFieldPage.st" /> 604 613 <None Include="App_Data\SqlTemplates\UI\WebControls\RowStyleFieldPage.st" /> 605 614 <Content Include="App_Data\SqlTemplates\UI\WebControls\SelectFieldBoundInnerGridViewPage.st" /> -
framework/trunk/WebLibrary/Properties/Resources.designer.cs
r1616 r1633 824 824 825 825 /// <summary> 826 /// The value type '{1}' bound to RadioButtonField '{0}' cannot be converted from a string. に類似しているローカライズされた文字列を検索します。 827 /// </summary> 828 internal static string Http_RadioButtonField_CannotConvertFromString { 829 get { 830 return ResourceManager.GetString("Http_RadioButtonField_CannotConvertFromString", resourceCulture); 831 } 832 } 833 834 /// <summary> 835 /// ValueToCompare value '{2}' of RadioButtonField '{0}' cannot be converted to bound value type '{1}'. に類似しているローカライズされた文字列を検索します。 836 /// </summary> 837 internal static string Http_RadioButtonField_CannotConvertValueToCompare { 838 get { 839 return ResourceManager.GetString("Http_RadioButtonField_CannotConvertValueToCompare", resourceCulture); 840 } 841 } 842 843 /// <summary> 844 /// RadioButtonField '{0}' contains a control that isn't a RadioButton. Override OnDataBindField to inherit from RadioButtonField and add different controls. に類似しているローカライズされた文字列を検索します。 845 /// </summary> 846 internal static string Http_RadioButtonField_WrongControlType { 847 get { 848 return ResourceManager.GetString("Http_RadioButtonField_WrongControlType", resourceCulture); 849 } 850 } 851 852 /// <summary> 826 853 /// Server operation is not available in this context. に類似しているローカライズされた文字列を検索します。 827 854 /// </summary> … … 1018 1045 get { 1019 1046 return ResourceManager.GetString("InvalidOperation_CouldNotFindControl", resourceCulture); 1047 } 1048 } 1049 1050 /// <summary> 1051 /// Data keys must be specified on GridView '{0}' before the data keys can be retrieved. Use the DataKeyNames property to specify data keys. に類似しているローカライズされた文字列を検索します。 1052 /// </summary> 1053 internal static string InvalidOperation_GridView_DataKeyNamesMustBeSpecified { 1054 get { 1055 return ResourceManager.GetString("InvalidOperation_GridView_DataKeyNamesMustBeSpecified", resourceCulture); 1020 1056 } 1021 1057 } … … 1968 2004 1969 2005 /// <summary> 2006 /// The property {1} is not supported on {0}. に類似しているローカライズされた文字列を検索します。 2007 /// </summary> 2008 internal static string NotSupported_Property { 2009 get { 2010 return ResourceManager.GetString("NotSupported_Property", resourceCulture); 2011 } 2012 } 2013 2014 /// <summary> 1970 2015 /// Property is read only. に類似しているローカライズされた文字列を検索します。 1971 2016 /// </summary> -
framework/trunk/WebLibrary/Properties/Resources.resx
r1616 r1633 937 937 <value>LinkedPropertyPositiveValue and LinkedPropertyNegativeValue must be a settable value for the property in ControlPropertyLinkageConnector '{0}'.</value> 938 938 </data> 939 <data name="Http_RadioButtonField_WrongControlType" xml:space="preserve"> 940 <value>RadioButtonField '{0}' contains a control that isn't a RadioButton. Override OnDataBindField to inherit from RadioButtonField and add different controls.</value> 941 </data> 942 <data name="Http_RadioButtonField_CannotConvertFromString" xml:space="preserve"> 943 <value>The value type '{1}' bound to RadioButtonField '{0}' cannot be converted from a string.</value> 944 </data> 945 <data name="Http_RadioButtonField_CannotConvertValueToCompare" xml:space="preserve"> 946 <value>ValueToCompare value '{2}' of RadioButtonField '{0}' cannot be converted to bound value type '{1}'.</value> 947 </data> 948 <data name="NotSupported_Property" xml:space="preserve"> 949 <value>The property {1} is not supported on {0}.</value> 950 </data> 951 <data name="InvalidOperation_GridView_DataKeyNamesMustBeSpecified" xml:space="preserve"> 952 <value>Data keys must be specified on GridView '{0}' before the data keys can be retrieved. Use the DataKeyNames property to specify data keys.</value> 953 </data> 939 954 </root> -
framework/trunk/WebLibrary/Sources/UI/WebControls/GridView.cs
r1604 r1633 26 26 using System.Collections; 27 27 using System.Collections.Generic; 28 using System.Collections.Specialized; 28 29 using System.ComponentModel; 30 using System.Diagnostics; 31 using System.Globalization; 29 32 using System.Reflection; 30 33 using System.Web; 31 34 using System.Web.UI; 32 35 using System.Web.UI.WebControls; 36 using FCSoft.SilverFrost.Framework.Collection; 33 37 using FCSoft.SilverFrost.Framework.Reflection; 38 using FCSoft.SilverFrost.Framework.Web.Properties; 34 39 35 40 … … 180 185 get 181 186 { 187 EnsureDataKeys(); 188 182 189 int targetIndex = GetSelectFieldIndex(); 183 190 if (targetIndex == -1) … … 211 218 get 212 219 { 220 EnsureDataKeys(); 221 213 222 List<int> targetIndexes = new List<int>(); 214 223 DataControlFieldCollection columns = Columns; … … 287 296 get 288 297 { 298 EnsureDataKeys(); 299 289 300 int targetIndex = GetSelectFieldIndex(); 290 301 if (targetIndex == -1) … … 314 325 if (Rows.Count != 0) 315 326 { 327 EnsureDataKeys(); 316 328 UpdateSelectFieldState(); 317 329 } … … 544 556 545 557 /// <summary> 558 /// 指定したデータフィールド名に対応する値の一覧を返します。 559 /// </summary> 560 /// <param name="dataField">データフィールド名。</param> 561 /// <returns> 562 /// 対応するデータフィールドにバインドされたデータのディクショナリです。 563 /// レコードを識別するための <see cref="DataKey"/> をキーとして、 564 /// バインドされた値を値として格納されています。 565 /// 表示されている行の順番で格納されています。 566 /// </returns> 567 /// <remarks> 568 /// 現在このメソッドで取得可能なバインドフィールドは 569 /// <see cref="RadioButtonField"/> のみです。 570 /// </remarks> 571 public OrderedDictionary<DataKey, object> GetValues(string dataField) 572 { 573 EnsureDataKeys(); 574 575 IList<BoundFieldAccessor> boundFieldAccessors = GetBoundFieldAccessors(dataField); 576 if (boundFieldAccessors == null) 577 { 578 return null; 579 } 580 581 GridViewRowCollection rows = Rows; 582 DataKeyArray allKeys = DataKeys; 583 584 OrderedDictionary<DataKey, object> dictionary = new OrderedDictionary<DataKey, object>(rows.Count); 585 586 foreach (GridViewRow row in rows) 587 { 588 // データ行以外は無視 589 if (row.RowType != DataControlRowType.DataRow) 590 { 591 continue; 592 } 593 594 DataKey dataKey = allKeys[row.RowIndex]; 595 if (dataKey == null) 596 { 597 continue; 598 } 599 600 // ExtractValuesFromCell メソッドを使用してフィールドの値を収集 (フィールドが複数ある場合は後勝ち) 601 OrderedDictionary cellValueDictionary = new OrderedDictionary(); 602 foreach (BoundFieldAccessor boundFieldAccessor in boundFieldAccessors) 603 { 604 DataControlFieldCell cell = (DataControlFieldCell)row.Cells[boundFieldAccessor.ColumnIndex]; 605 boundFieldAccessor.BoundField.ExtractValuesFromCell(cellValueDictionary, cell, DataControlRowState.Normal, true); 606 } 607 608 dictionary.Add( 609 dataKey, 610 cellValueDictionary.Contains(dataField) ? cellValueDictionary[dataField] : null); 611 } 612 613 return dictionary; 614 } 615 616 /// <summary> 546 617 /// <see cref="BaseDataBoundControl.DataSourceID"/> 547 618 /// プロパティが設定されていて、データ バインド コントロールにバインディングが必要とマークされている場合に、 … … 568 639 if (selectedValues != null) 569 640 { 641 EnsureDataKeys(); 570 642 UpdateSelectFieldState(); 571 643 selectedValues = null; … … 930 1002 931 1003 /// <summary> 1004 /// 指定したデータフィールド名に対応する 1005 /// <see cref="BoundFieldAccessor"/> の一覧を返します。 1006 /// </summary> 1007 /// <param name="dataField">データフィールドの名前。</param> 1008 /// <returns> 1009 /// <see cref="BoundFieldAccessor"/> の一覧。 1010 /// 見付からない場合は <see langword="null"/>。 1011 /// </returns> 1012 private IList<BoundFieldAccessor> GetBoundFieldAccessors(string dataField) 1013 { 1014 List<BoundFieldAccessor> indexes = new List<BoundFieldAccessor>(); 1015 1016 DataControlFieldCollection columns = Columns; 1017 for (int i = 0; i < columns.Count; i++) 1018 { 1019 System.Web.UI.WebControls.BoundField boundField = columns[i] as System.Web.UI.WebControls.BoundField; 1020 if (boundField != null && Equals(boundField.DataField, dataField)) 1021 { 1022 indexes.Add(new BoundFieldAccessor(i, boundField)); 1023 } 1024 } 1025 1026 return indexes.Count > 0 ? indexes : null; 1027 } 1028 1029 /// <summary> 932 1030 /// データキーの最初のフィールドを検査し、全ての最初のフィールドの値を格納可能な型を返します。 933 1031 /// </summary> … … 1052 1150 } 1053 1151 } 1152 1153 /// <summary> 1154 /// <see cref="System.Web.UI.WebControls.GridView.DataKeys"/> が使えるかチェックします。 1155 /// </summary> 1156 private void EnsureDataKeys() 1157 { 1158 if (DataKeyNames.Length == 0) 1159 { 1160 throw new InvalidOperationException( 1161 string.Format( 1162 CultureInfo.CurrentCulture, 1163 Resources.InvalidOperation_GridView_DataKeyNamesMustBeSpecified, 1164 ID)); 1165 } 1166 } 1167 1168 1169 /// <summary> 1170 /// バウンドフィールドにアクセスするためのクラスです。 1171 /// </summary> 1172 [DebuggerDisplay(@"\{ColumnIdex = {columnIndex} DataField = {boundField.DataField}\}")] 1173 private sealed class BoundFieldAccessor 1174 { 1175 /// <summary> 1176 /// カラムのインデックス番号。 1177 /// </summary> 1178 [DebuggerBrowsable(DebuggerBrowsableState.Never)] 1179 private readonly int columnIndex; 1180 1181 /// <summary> 1182 /// <see cref="System.Web.UI.WebControls.BoundField"/>。 1183 /// </summary> 1184 [DebuggerBrowsable(DebuggerBrowsableState.Never)] 1185 private readonly System.Web.UI.WebControls.BoundField boundField; 1186 1187 1188 /// <summary> 1189 /// インスタンスを作成します。 1190 /// </summary> 1191 /// <param name="columnIndex">カラムのインデックス番号。</param> 1192 /// <param name="boundField"><see cref="System.Web.UI.WebControls.BoundField"/>。</param> 1193 internal BoundFieldAccessor(int columnIndex, System.Web.UI.WebControls.BoundField boundField) 1194 { 1195 this.columnIndex = columnIndex; 1196 this.boundField = boundField; 1197 } 1198 1199 /// <summary> 1200 /// カラムのインデックス番号を取得します。 1201 /// </summary> 1202 /// <value> 1203 /// カラムのインデックス番号。 1204 /// </value> 1205 internal int ColumnIndex 1206 { 1207 get 1208 { 1209 return columnIndex; 1210 } 1211 } 1212 1213 /// <summary> 1214 /// <see cref="System.Web.UI.WebControls.BoundField"/> を取得します。 1215 /// </summary> 1216 /// <value> 1217 /// <see cref="System.Web.UI.WebControls.BoundField"/>。 1218 /// </value> 1219 internal System.Web.UI.WebControls.BoundField BoundField 1220 { 1221 get 1222 { 1223 return boundField; 1224 } 1225 } 1226 } 1054 1227 } 1055 1228 } -
framework/trunk/WebLibrary/Sources/UI/WebControls/RadioButton.cs
r1348 r1633 57 57 private const string ForceRenderLabelKey = "ForceRenderLabel"; 58 58 59 /// <summary> 60 /// <see cref="InnerValue"/> プロパティ用のキー。 61 /// </summary> 62 private const string InnerValueKey = "InnerValue"; 63 59 64 // AgentSmith SpellCheck Disable 60 65 … … 142 147 } 143 148 149 /// <summary> 150 /// 内部の値を取得または設定します。 151 /// </summary> 152 /// <value> 153 /// 内部の値。 154 /// </value> 155 internal object InnerValue 156 { 157 get 158 { 159 return ViewState[InnerValueKey]; 160 } 161 162 set 163 { 164 ViewState[InnerValueKey] = value; 165 } 166 } 167 144 168 145 169 /// <summary> -
framework/trunk/WebLibrary/WebLibrary.csproj
r1619 r1633 166 166 <Compile Include="Sources\UI\WebControls\NumericBox.cs" /> 167 167 <Compile Include="Sources\UI\WebControls\ObjectDataSource.cs" /> 168 <Compile Include="Sources\UI\WebControls\RadioButtonField.cs" /> 168 169 <Compile Include="Sources\UI\WebControls\Reloader.cs" /> 169 170 <Compile Include="Sources\UI\WebControls\DialogOpenButton.cs" />
※ 詳しい使い方は
TracChangeset を参照してください。