チェンジセット 1653 (default)


以下の違いを無視:
日時:
2024/06/23 23:25:49 (3ヵ月前)
更新者:
hizuya@…
ログメッセージ:
  • Dialog を使うときに、呼び出し側のコントロールからサイズとタイトルを設定できるようにした。
場所:
framework/trunk
ファイル:
8個の更新

凡例:

未変更
追加
削除
  • framework/trunk/WebApplication/UI/WebControls/DialogPage.aspx

    r1478 r1653  
    267267            Result: <asp:Label ID="DialogResultLabel1101" runat="server" /> 
    268268 
     269            <h2>Dialog Option By OpenButton</h2> 
     270 
     271            <sff:Dialog ID="Dialog1201" runat="server" 
     272                Width="800" 
     273                Height="720" 
     274                OnResultChanged="Dialog1201_ResultChanged" /> 
     275 
     276            <sff:DialogOpenButton ID="DialogOpenButton1201A" runat="server" 
     277                DialogControl="Dialog1201" 
     278                Text="Open(A)" 
     279                NavigateUrl="~/UI/WebControls/DialogPageNestedPage.aspx" 
     280                DialogControlTitle="Dialog Title A"/> 
     281            <sff:DialogOpenButton ID="DialogOpenButton1201B" runat="server" 
     282                DialogControl="Dialog1201" 
     283                Text="Open(B)" 
     284                NavigateUrl="~/UI/WebControls/DialogPageNestedPage.aspx" 
     285                DialogControlTitle="Dialog Title B" 
     286                DialogControlWidth="500" 
     287                DialogControlHeight="400"/> 
     288            Result: <asp:Label ID="DialogResultLabel1201" runat="server" /> 
     289 
    269290        </div> 
    270291    </form> 
  • framework/trunk/WebApplication/UI/WebControls/DialogPage.aspx.cs

    r1478 r1653  
    116116            DialogResultLabel1001.Text = Dialog1001.Result; 
    117117            DialogResultLabel1101.Text = Dialog1101.Result; 
     118            DialogResultLabel1201.Text = Dialog1201.Result; 
    118119        } 
    119120 
     
    284285        { 
    285286            DialogResultLabel1101.Font.Bold = true; 
     287        } 
     288 
     289        /// <summary> 
     290        /// ダイアログの戻り値が変更されたときに呼び出されるイベントハンドラです。 
     291        /// </summary> 
     292        /// <param name="sender"> 
     293        /// イベントの発生元。 
     294        /// </param> 
     295        /// <param name="e"> 
     296        /// イベント情報。 
     297        /// </param> 
     298        protected void Dialog1201_ResultChanged(object sender, EventArgs e) 
     299        { 
     300            DialogResultLabel1201.Font.Bold = true; 
    286301        } 
    287302 
  • framework/trunk/WebApplication/UI/WebControls/DialogPage.aspx.designer.cs

    r1478 r1653  
    363363        /// </remarks> 
    364364        protected global::System.Web.UI.WebControls.Label DialogResultLabel1101; 
     365         
     366        /// <summary> 
     367        /// Dialog1201 コントロール。 
     368        /// </summary> 
     369        /// <remarks> 
     370        /// 自動生成されたフィールド。 
     371        /// 変更するには、フィールドの宣言をデザイナー ファイルから分離コード ファイルに移動します。 
     372        /// </remarks> 
     373        protected global::FCSoft.SilverFrost.Framework.Web.UI.WebControls.Dialog Dialog1201; 
     374         
     375        /// <summary> 
     376        /// DialogOpenButton1201A コントロール。 
     377        /// </summary> 
     378        /// <remarks> 
     379        /// 自動生成されたフィールド。 
     380        /// 変更するには、フィールドの宣言をデザイナー ファイルから分離コード ファイルに移動します。 
     381        /// </remarks> 
     382        protected global::FCSoft.SilverFrost.Framework.Web.UI.WebControls.DialogOpenButton DialogOpenButton1201A; 
     383         
     384        /// <summary> 
     385        /// DialogOpenButton1201B コントロール。 
     386        /// </summary> 
     387        /// <remarks> 
     388        /// 自動生成されたフィールド。 
     389        /// 変更するには、フィールドの宣言をデザイナー ファイルから分離コード ファイルに移動します。 
     390        /// </remarks> 
     391        protected global::FCSoft.SilverFrost.Framework.Web.UI.WebControls.DialogOpenButton DialogOpenButton1201B; 
     392         
     393        /// <summary> 
     394        /// DialogResultLabel1201 コントロール。 
     395        /// </summary> 
     396        /// <remarks> 
     397        /// 自動生成されたフィールド。 
     398        /// 変更するには、フィールドの宣言をデザイナー ファイルから分離コード ファイルに移動します。 
     399        /// </remarks> 
     400        protected global::System.Web.UI.WebControls.Label DialogResultLabel1201; 
    365401    } 
    366402} 
  • framework/trunk/WebLibrary/Resources/Script/UIIFrameDialog.js

    r1478 r1653  
    131131 
    132132                        switch (key) { 
     133                        case 'width': 
     134                        case 'height': 
     135                        case 'minWidth': 
     136                        case 'minHeight': 
     137                        case 'maxWidth': 
     138                        case 'maxHeight': 
     139                        case 'closeOnEscape': 
     140                        case 'resizable': 
     141                        case 'draggable': 
     142                        case 'modal': 
    133143                        case 'title': 
    134144                                this._dialog.dialog('option', key, value); 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/Dialog.cs

    r1478 r1653  
    2727    using System.Collections.Specialized; 
    2828    using System.ComponentModel; 
     29    using System.Diagnostics; 
    2930    using System.Globalization; 
    3031    using System.Net; 
     32    using System.Text; 
    3133    using System.Web.UI; 
    3234    using System.Web.UI.WebControls; 
     
    9698 
    9799 
     100        /// <summary> 
     101        /// クライアントスクリプトに指定する <c>width</c> の初期値。 
     102        /// </summary> 
     103        private const string ScriptWidthDefault = "300"; 
     104 
     105        /// <summary> 
     106        /// クライアントスクリプトに指定する <c>height</c> の初期値。 
     107        /// </summary> 
     108        private const string ScriptHeightDefault = "'auto'"; 
     109 
     110        /// <summary> 
     111        /// クライアントスクリプトに指定する <c>minWidth</c> の初期値。 
     112        /// </summary> 
     113        private const string ScriptMinWidthDefault = "150"; 
     114 
     115        /// <summary> 
     116        /// クライアントスクリプトに指定する <c>minHeight</c> の初期値。 
     117        /// </summary> 
     118        private const string ScriptMinHeightDefault = "150"; 
     119 
     120        /// <summary> 
     121        /// クライアントスクリプトに指定する <c>maxWidth</c> の初期値。 
     122        /// </summary> 
     123        private const string ScriptMaxWidthDefault = "false"; 
     124 
     125        /// <summary> 
     126        /// クライアントスクリプトに指定する <c>maxHeight</c> の初期値。 
     127        /// </summary> 
     128        private const string ScriptMaxHeightDefault = "false"; 
     129 
     130 
    98131 
    99132        /// <summary> 
     
    786819        public void Open(string relativeUrl) 
    787820        { 
    788             RegisterOpenScript(null, null, ResolveClientUrl(relativeUrl), null); 
     821            RegisterOpenScript(null, null, null, ResolveClientUrl(relativeUrl), null); 
    789822        } 
    790823 
     
    797830        { 
    798831            RegisterOpenScript( 
     832                null, 
    799833                null, 
    800834                WebRequestMethods.Http.Post, 
     
    929963        /// 登録するコントロール。 
    930964        /// </param> 
     965        /// <param name="dialogOption"> 
     966        /// ダイアログを開くときのダイアログの追加のオプション。 
     967        /// このコントロールの設定を使用する場合は <see langword="null"/>。 
     968        /// </param> 
    931969        /// <param name="method"> 
    932970        /// ダイアログを開くときに使用する HTTP メソッド。 
     
    937975        /// <paramref name="control"/> がリンクでそのリンク先を使用する場合は <see langword="null"/> 参照。 
    938976        /// </param> 
    939         /// <param name="options"> 
    940         /// ダイアログを開くときの追加の値を表す Json 文字列。 
    941         /// </param> 
    942         internal void RegisterOnClientClick(Control control, string method, string url, string options) 
    943         { 
    944             RegisterOpenScript(control, method, url, options); 
     977        /// <param name="formOptions"> 
     978        /// ダイアログを POST で開くときの URL に追加で渡す値を表す Json 文字列。 
     979        /// </param> 
     980        internal void RegisterOnClientClick(Control control, DialogOption dialogOption, string method, string url, string formOptions) 
     981        { 
     982            RegisterOpenScript(control, dialogOption, method, url, formOptions); 
    945983        } 
    946984 
     
    10691107    $('#" + ClientID + @"').iframedialog({ 
    10701108        iframeId: '" + ClientID + InlineFrameSuffix + @"', 
    1071         width: " + (width != Unit.Empty ? width.Value.ToString(CultureInfo.InvariantCulture) : "300") + @", 
    1072         height: " + (height != Unit.Empty ? height.Value.ToString(CultureInfo.InvariantCulture) : "'auto'") + @", 
    1073         minWidth: " + (minWidth != Unit.Empty ? minWidth.Value.ToString(CultureInfo.InvariantCulture) : "150") + @", 
    1074         minHeight: " + (minHeight != Unit.Empty ? minHeight.Value.ToString(CultureInfo.InvariantCulture) : "150") + @", 
    1075         maxWidth: " + (maxWidth != Unit.Empty ? maxWidth.Value.ToString(CultureInfo.InvariantCulture) : "false") + @", 
    1076         maxHeight: " + (maxHeight != Unit.Empty ? maxHeight.Value.ToString(CultureInfo.InvariantCulture) : "false") + @", 
     1109        width: " + (width != Unit.Empty ? width.Value.ToString(CultureInfo.InvariantCulture) : ScriptWidthDefault) + @", 
     1110        height: " + (height != Unit.Empty ? height.Value.ToString(CultureInfo.InvariantCulture) : ScriptHeightDefault) + @", 
     1111        minWidth: " + (minWidth != Unit.Empty ? minWidth.Value.ToString(CultureInfo.InvariantCulture) : ScriptMinWidthDefault) + @", 
     1112        minHeight: " + (minHeight != Unit.Empty ? minHeight.Value.ToString(CultureInfo.InvariantCulture) : ScriptMinHeightDefault) + @", 
     1113        maxWidth: " + (maxWidth != Unit.Empty ? maxWidth.Value.ToString(CultureInfo.InvariantCulture) : ScriptMaxWidthDefault) + @", 
     1114        maxHeight: " + (maxHeight != Unit.Empty ? maxHeight.Value.ToString(CultureInfo.InvariantCulture) : ScriptMaxHeightDefault) + @", 
    10771115        closeOnEscape: " + CloseOnEscape.ToString().ToLowerInvariant() + @", 
    10781116        resizable: " + Resizable.ToString().ToLowerInvariant() + @", 
     
    11111149            if (Page != null) 
    11121150            { 
     1151                // ReSharper disable once ExceptionNotDocumented 
    11131152                Page.VerifyRenderingInServerForm(this); 
    11141153                Page.ClientScript.RegisterForEventValidation(uniqueID); 
     
    11471186        /// ページロード時に自動で開く場合は <see langword="null"/>。 
    11481187        /// </param> 
     1188        /// <param name="dialogOption"> 
     1189        /// ダイアログを開くときのダイアログの追加のオプション。 
     1190        /// このコントロールの設定を使用する場合は <see langword="null"/>。 
     1191        /// </param> 
    11491192        /// <param name="method"> 
    11501193        /// ダイアログを開くときに使用する HTTP メソッド。 
     
    11551198        /// <paramref name="control"/> がリンクでそのリンク先を使用する場合は <see langword="null"/> 参照。 
    11561199        /// </param> 
    1157         /// <param name="options"> 
    1158         /// ダイアログを開くときの追加の値を表す Json 文字列。 
    1159         /// </param> 
    1160         private void RegisterOpenScript(Control control, string method, string url, string options) 
     1200        /// <param name="formOptions"> 
     1201        /// ダイアログを POST で開くときの URL に追加で渡す値を表す Json 文字列。 
     1202        /// </param> 
     1203        private void RegisterOpenScript(Control control, DialogOption dialogOption, string method, string url, string formOptions) 
    11611204        { 
    11621205            // FIXME いらないのでは? 
     
    11681211              + (method != null ? "'" + ClientScriptUtility.EscapeStringForSingleQuotes(method) + "'" : "null") + ", url: " 
    11691212              + (url != null ? "'" + ClientScriptUtility.EscapeStringForSingleQuotes(url) + "'" : "null") + ", options: " 
    1170               + (options ?? "null") + @" }).iframedialog('open'); 
     1213              + (formOptions ?? "null") + @" })" 
     1214              + (dialogOption != null ? ".iframedialog('option', " + dialogOption.ToOptionClientScript(this) + ")" : string.Empty) 
     1215              + @".iframedialog('open'); 
    11711216        return false; 
    11721217    }"; 
     
    11861231                true); 
    11871232        } 
     1233 
     1234 
     1235        /// <summary> 
     1236        /// ダイアログのオプションを表すクラスです。 
     1237        /// </summary> 
     1238        internal class DialogOption 
     1239        { 
     1240            /// <summary> 
     1241            /// ダイアログのタイトル。 
     1242            /// </summary> 
     1243            [DebuggerBrowsable(DebuggerBrowsableState.Never)] 
     1244            private readonly string title; 
     1245 
     1246            /// <summary> 
     1247            /// ダイアログの幅。 
     1248            /// </summary> 
     1249            [DebuggerBrowsable(DebuggerBrowsableState.Never)] 
     1250            private readonly Unit width; 
     1251 
     1252            /// <summary> 
     1253            /// ダイアログの高さ。 
     1254            /// </summary> 
     1255            [DebuggerBrowsable(DebuggerBrowsableState.Never)] 
     1256            private readonly Unit height; 
     1257 
     1258            /// <summary> 
     1259            /// ダイアログの最小の幅。 
     1260            /// </summary> 
     1261            [DebuggerBrowsable(DebuggerBrowsableState.Never)] 
     1262            private readonly Unit minWidth; 
     1263 
     1264            /// <summary> 
     1265            /// ダイアログの最小の高さ。 
     1266            /// </summary> 
     1267            [DebuggerBrowsable(DebuggerBrowsableState.Never)] 
     1268            private readonly Unit minHeight; 
     1269 
     1270            /// <summary> 
     1271            /// ダイアログの最大の幅。 
     1272            /// </summary> 
     1273            [DebuggerBrowsable(DebuggerBrowsableState.Never)] 
     1274            private readonly Unit maxWidth; 
     1275 
     1276            /// <summary> 
     1277            /// ダイアログの最大の高さ。 
     1278            /// </summary> 
     1279            [DebuggerBrowsable(DebuggerBrowsableState.Never)] 
     1280            private readonly Unit maxHeight; 
     1281 
     1282 
     1283            /// <summary> 
     1284            /// インスタンスを作成します。 
     1285            /// </summary> 
     1286            /// <param name="title">ダイアログのタイトル。</param> 
     1287            /// <param name="width">ダイアログの幅。</param> 
     1288            /// <param name="height">ダイアログの高さ。</param> 
     1289            /// <param name="minWidth">ダイアログの最小の幅。</param> 
     1290            /// <param name="minHeight">ダイアログの最小の高さ。</param> 
     1291            /// <param name="maxWidth">ダイアログの最大の幅。</param> 
     1292            /// <param name="maxHeight">ダイアログの最大の高さ。</param> 
     1293            internal DialogOption( 
     1294                string title, 
     1295                Unit width, 
     1296                Unit height, 
     1297                Unit minWidth, 
     1298                Unit minHeight, 
     1299                Unit maxWidth, 
     1300                Unit maxHeight) 
     1301            { 
     1302                this.title = title; 
     1303                this.width = width; 
     1304                this.height = height; 
     1305                this.minWidth = minWidth; 
     1306                this.minHeight = minHeight; 
     1307                this.maxWidth = maxWidth; 
     1308                this.maxHeight = maxHeight; 
     1309            } 
     1310 
     1311 
     1312            /// <summary> 
     1313            /// ダイアログのタイトルを取得します。 
     1314            /// </summary> 
     1315            /// <value> 
     1316            /// ダイアログのタイトル。 
     1317            /// </value> 
     1318            internal string Title 
     1319            { 
     1320                get 
     1321                { 
     1322                    return title; 
     1323                } 
     1324            } 
     1325 
     1326            /// <summary> 
     1327            /// ダイアログの幅を取得します。 
     1328            /// </summary> 
     1329            /// <value> 
     1330            /// ダイアログの幅。 
     1331            /// </value> 
     1332            internal Unit Width 
     1333            { 
     1334                get 
     1335                { 
     1336                    return width; 
     1337                } 
     1338            } 
     1339 
     1340            /// <summary> 
     1341            /// ダイアログの高さを取得します。 
     1342            /// </summary> 
     1343            /// <value> 
     1344            /// ダイアログの高さ。 
     1345            /// </value> 
     1346            internal Unit Height 
     1347            { 
     1348                get 
     1349                { 
     1350                    return height; 
     1351                } 
     1352            } 
     1353 
     1354            /// <summary> 
     1355            /// ダイアログの最小の幅を取得します。 
     1356            /// </summary> 
     1357            /// <value> 
     1358            /// ダイアログの最小の幅。 
     1359            /// </value> 
     1360            internal Unit MinWidth 
     1361            { 
     1362                get 
     1363                { 
     1364                    return minWidth; 
     1365                } 
     1366            } 
     1367 
     1368            /// <summary> 
     1369            /// ダイアログの最小の高さを取得します。 
     1370            /// </summary> 
     1371            /// <value> 
     1372            /// ダイアログの最小の高さ。 
     1373            /// </value> 
     1374            internal Unit MinHeight 
     1375            { 
     1376                get 
     1377                { 
     1378                    return minHeight; 
     1379                } 
     1380            } 
     1381 
     1382            /// <summary> 
     1383            /// ダイアログの最大の幅を取得します。 
     1384            /// </summary> 
     1385            /// <value> 
     1386            /// ダイアログの最大の幅。 
     1387            /// </value> 
     1388            internal Unit MaxWidth 
     1389            { 
     1390                get 
     1391                { 
     1392                    return maxWidth; 
     1393                } 
     1394            } 
     1395 
     1396            /// <summary> 
     1397            /// ダイアログの最大の高さを取得します。 
     1398            /// </summary> 
     1399            /// <value> 
     1400            /// ダイアログの最大の高さ。 
     1401            /// </value> 
     1402            internal Unit MaxHeight 
     1403            { 
     1404                get 
     1405                { 
     1406                    return maxHeight; 
     1407                } 
     1408            } 
     1409 
     1410 
     1411            /// <summary> 
     1412            /// オプションに使用するクライアントスクリプトを取得します。 
     1413            /// </summary> 
     1414            /// <param name="dialog">開く対象の <see cref="Dialog"/>。</param> 
     1415            /// <returns> 
     1416            /// オプションに使用するクライアントスクリプト。 
     1417            /// </returns> 
     1418            internal string ToOptionClientScript(Dialog dialog) 
     1419            { 
     1420                StringBuilder builder = new StringBuilder(); 
     1421                builder.Append("{ title: '"); 
     1422                if (title != null) 
     1423                { 
     1424                    builder.Append(ClientScriptUtility.EscapeStringForSingleQuotes(title)); 
     1425                } 
     1426 
     1427                builder.Append('\''); 
     1428 
     1429                AddOption(builder, "width", width, dialog.Width, ScriptWidthDefault); 
     1430                AddOption(builder, "height", height, dialog.Height, ScriptHeightDefault); 
     1431                AddOption(builder, "minWidth", minWidth, dialog.MinWidth, ScriptMinWidthDefault); 
     1432                AddOption(builder, "minHeight", minHeight, dialog.MinHeight, ScriptMinHeightDefault); 
     1433                AddOption(builder, "maxWidth", maxWidth, dialog.MaxWidth, ScriptMaxWidthDefault); 
     1434                AddOption(builder, "maxHeight", maxHeight, dialog.MaxHeight, ScriptMaxHeightDefault); 
     1435                builder.Append(" }"); 
     1436 
     1437                return builder.ToString(); 
     1438            } 
     1439 
     1440            /// <summary> 
     1441            /// オプション値を追加します。 
     1442            /// </summary> 
     1443            /// <param name="builder">オプション値を設定する文字列ビルダー。</param> 
     1444            /// <param name="key">オプションのキー。</param> 
     1445            /// <param name="overwriteValue">上書きする値。</param> 
     1446            /// <param name="baseValue">元の値。</param> 
     1447            /// <param name="defaultValue">オプションのデフォルト値。</param> 
     1448            private static void AddOption(StringBuilder builder, string key, Unit overwriteValue, Unit baseValue, string defaultValue) 
     1449            { 
     1450                Unit value = overwriteValue != Unit.Empty ? overwriteValue : baseValue; 
     1451                builder.Append(", "); 
     1452                builder.Append(key); 
     1453                builder.Append(": "); 
     1454                builder.Append( 
     1455                    value != Unit.Empty 
     1456                        ? value.Value.ToString(CultureInfo.InvariantCulture) 
     1457                        : defaultValue); 
     1458            } 
     1459        } 
    11881460    } 
    11891461} 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/DialogOpenButton.cs

    r1625 r1653  
    2929    using System.Web.UI.WebControls; 
    3030    using FCSoft.SilverFrost.Framework.Json; 
     31    using FCSoft.SilverFrost.Framework.Web.Properties; 
    3132 
    3233 
     
    6566        private const string DialogControlKey = "DialogControl"; 
    6667 
     68        /// <summary> 
     69        /// <see cref="DialogControlTitle"/> プロパティ用のキー。 
     70        /// </summary> 
     71        private const string DialogControlTitleKey = "DialogControlTitle"; 
     72 
     73        /// <summary> 
     74        /// <see cref="DialogControlWidth"/> プロパティ用のキー。 
     75        /// </summary> 
     76        private const string DialogControlWidthKey = "DialogControlWidth"; 
     77 
     78        /// <summary> 
     79        /// <see cref="DialogControlHeight"/> プロパティ用のキー。 
     80        /// </summary> 
     81        private const string DialogControlHeightKey = "DialogControlHeight"; 
     82 
     83        /// <summary> 
     84        /// <see cref="DialogControlMinWidth"/> プロパティ用のキー。 
     85        /// </summary> 
     86        private const string DialogControlMinWidthKey = "DialogControlMinWidth"; 
     87 
     88        /// <summary> 
     89        /// <see cref="DialogControlMinHeight"/> プロパティ用のキー。 
     90        /// </summary> 
     91        private const string DialogControlMinHeightKey = "DialogControlMinHeight"; 
     92 
     93        /// <summary> 
     94        /// <see cref="DialogControlMaxWidth"/> プロパティ用のキー。 
     95        /// </summary> 
     96        private const string DialogControlMaxWidthKey = "DialogControlMaxWidth"; 
     97 
     98        /// <summary> 
     99        /// <see cref="DialogControlMaxHeight"/> プロパティ用のキー。 
     100        /// </summary> 
     101        private const string DialogControlMaxHeightKey = "DialogControlMaxHeight"; 
     102 
    67103 
    68104        /// <summary> 
     
    219255 
    220256                ViewState[DialogControlKey] = value; 
     257            } 
     258        } 
     259 
     260        /// <summary> 
     261        /// ダイアログのタイトルを取得及び設定します。 
     262        /// </summary> 
     263        /// <value> 
     264        /// ダイアログのタイトル。 
     265        /// 既定値は空の文字列 ("")。 
     266        /// 空の文字列の場合は <see cref="DialogControl"/> で指定された 
     267        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     268        /// </value> 
     269        [Themeable(false)] 
     270        [DefaultValue("")] 
     271        [Localizable(true)] 
     272        [WebCategory("Appearance")] 
     273        [WebDescription("Description_DialogControlTitle")] 
     274        public virtual string DialogControlTitle 
     275        { 
     276            get 
     277            { 
     278                return (string)(ViewState[DialogControlTitleKey] ?? string.Empty); 
     279            } 
     280 
     281            set 
     282            { 
     283                ViewState[DialogControlTitleKey] = value; 
     284            } 
     285        } 
     286 
     287        /// <summary> 
     288        /// ダイアログの幅を取得または設定します。 
     289        /// </summary> 
     290        /// <value> 
     291        /// ダイアログの幅を表す <see cref="Unit"/>。 
     292        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     293        /// 既定値は <see cref="Unit.Empty"/> です。 
     294        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     295        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     296        /// </value> 
     297        /// <exception cref="ArgumentException"> 
     298        /// ピクセル以外の単位が設定されました。 
     299        /// </exception> 
     300        [Bindable(true)] 
     301        [Localizable(true)] 
     302        [DefaultValue(typeof(Unit), "")] 
     303        [WebCategory("Layout")] 
     304        [WebDescription("Description_DialogControlWidth")] 
     305        public virtual Unit DialogControlWidth 
     306        { 
     307            get 
     308            { 
     309                return (Unit)(ViewState[DialogControlWidthKey] ?? Unit.Empty); 
     310            } 
     311 
     312            set 
     313            { 
     314                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     315                { 
     316                    throw new ArgumentException(Utility.Format( 
     317                        Resources.InvalidOperation_UnitIsPixelOnly, 
     318                        "DialogControlWidth", 
     319                        ID)); 
     320                } 
     321 
     322                ViewState[DialogControlWidthKey] = value; 
     323            } 
     324        } 
     325 
     326        /// <summary> 
     327        /// ダイアログの高さを取得または設定します。 
     328        /// </summary> 
     329        /// <value> 
     330        /// ダイアログの高さを表す <see cref="Unit"/>。 
     331        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     332        /// 既定値は <see cref="Unit.Empty"/> です。 
     333        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     334        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     335        /// </value> 
     336        /// <exception cref="ArgumentException"> 
     337        /// ピクセル以外の単位が設定されました。 
     338        /// </exception> 
     339        [Bindable(true)] 
     340        [Localizable(true)] 
     341        [DefaultValue(typeof(Unit), "")] 
     342        [WebCategory("Layout")] 
     343        [WebDescription("Description_DialogControlHeight")] 
     344        public virtual Unit DialogControlHeight 
     345        { 
     346            get 
     347            { 
     348                return (Unit)(ViewState[DialogControlHeightKey] ?? Unit.Empty); 
     349            } 
     350 
     351            set 
     352            { 
     353                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     354                { 
     355                    throw new ArgumentException(Utility.Format( 
     356                        Resources.InvalidOperation_UnitIsPixelOnly, 
     357                        "DialogControlHeight", 
     358                        ID)); 
     359                } 
     360 
     361                ViewState[DialogControlHeightKey] = value; 
     362            } 
     363        } 
     364 
     365        /// <summary> 
     366        /// ダイアログの最小の幅を取得または設定します。 
     367        /// </summary> 
     368        /// <value> 
     369        /// ダイアログの最小の幅を表す <see cref="Unit"/>。 
     370        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     371        /// 既定値は <see cref="Unit.Empty"/> です。 
     372        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     373        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     374        /// </value> 
     375        /// <exception cref="ArgumentException"> 
     376        /// ピクセル以外の単位が設定されました。 
     377        /// </exception> 
     378        [Bindable(true)] 
     379        [Localizable(true)] 
     380        [DefaultValue(typeof(Unit), "")] 
     381        [WebCategory("Layout")] 
     382        [WebDescription("Description_DialogControlMinWidth")] 
     383        public virtual Unit DialogControlMinWidth 
     384        { 
     385            get 
     386            { 
     387                return (Unit)(ViewState[DialogControlMinWidthKey] ?? Unit.Empty); 
     388            } 
     389 
     390            set 
     391            { 
     392                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     393                { 
     394                    throw new ArgumentException(Utility.Format( 
     395                        Resources.InvalidOperation_UnitIsPixelOnly, 
     396                        "DialogControlMinWidth", 
     397                        ID)); 
     398                } 
     399 
     400                ViewState[DialogControlMinWidthKey] = value; 
     401            } 
     402        } 
     403 
     404        /// <summary> 
     405        /// ダイアログの最小の高さを取得または設定します。 
     406        /// </summary> 
     407        /// <value> 
     408        /// ダイアログの最小の高さを表す <see cref="Unit"/>。 
     409        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     410        /// 既定値は <see cref="Unit.Empty"/> です。 
     411        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     412        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     413        /// </value> 
     414        /// <exception cref="ArgumentException"> 
     415        /// ピクセル以外の単位が設定されました。 
     416        /// </exception> 
     417        [Bindable(true)] 
     418        [Localizable(true)] 
     419        [DefaultValue(typeof(Unit), "")] 
     420        [WebCategory("Layout")] 
     421        [WebDescription("Description_DialogControlMinHeight")] 
     422        public virtual Unit DialogControlMinHeight 
     423        { 
     424            get 
     425            { 
     426                return (Unit)(ViewState[DialogControlMinHeightKey] ?? Unit.Empty); 
     427            } 
     428 
     429            set 
     430            { 
     431                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     432                { 
     433                    throw new ArgumentException(Utility.Format( 
     434                        Resources.InvalidOperation_UnitIsPixelOnly, 
     435                        "DialogControlMinHeight", 
     436                        ID)); 
     437                } 
     438 
     439                ViewState[DialogControlMinHeightKey] = value; 
     440            } 
     441        } 
     442 
     443        /// <summary> 
     444        /// ダイアログの最大の幅を取得または設定します。 
     445        /// </summary> 
     446        /// <value> 
     447        /// ダイアログの最大の幅を表す <see cref="Unit"/>。 
     448        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     449        /// 既定値は <see cref="Unit.Empty"/> です。 
     450        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     451        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     452        /// </value> 
     453        /// <exception cref="ArgumentException"> 
     454        /// ピクセル以外の単位が設定されました。 
     455        /// </exception> 
     456        [Bindable(true)] 
     457        [Localizable(true)] 
     458        [DefaultValue(typeof(Unit), "")] 
     459        [WebCategory("Layout")] 
     460        [WebDescription("Description_DialogControlMaxWidth")] 
     461        public virtual Unit DialogControlMaxWidth 
     462        { 
     463            get 
     464            { 
     465                return (Unit)(ViewState[DialogControlMaxWidthKey] ?? Unit.Empty); 
     466            } 
     467 
     468            set 
     469            { 
     470                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     471                { 
     472                    throw new ArgumentException(Utility.Format( 
     473                        Resources.InvalidOperation_UnitIsPixelOnly, 
     474                        "DialogControlMaxWidth", 
     475                        ID)); 
     476                } 
     477 
     478                ViewState[DialogControlMaxWidthKey] = value; 
     479            } 
     480        } 
     481 
     482        /// <summary> 
     483        /// ダイアログの最大の高さを取得または設定します。 
     484        /// </summary> 
     485        /// <value> 
     486        /// ダイアログの最大の高さを表す <see cref="Unit"/>。 
     487        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     488        /// 既定値は <see cref="Unit.Empty"/> です。 
     489        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     490        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     491        /// </value> 
     492        /// <exception cref="ArgumentException"> 
     493        /// ピクセル以外の単位が設定されました。 
     494        /// </exception> 
     495        [Bindable(true)] 
     496        [Localizable(true)] 
     497        [DefaultValue(typeof(Unit), "")] 
     498        [WebCategory("Layout")] 
     499        [WebDescription("Description_DialogControlMaxHeight")] 
     500        public virtual Unit DialogControlMaxHeight 
     501        { 
     502            get 
     503            { 
     504                return (Unit)(ViewState[DialogControlMaxHeightKey] ?? Unit.Empty); 
     505            } 
     506 
     507            set 
     508            { 
     509                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     510                { 
     511                    throw new ArgumentException(Utility.Format( 
     512                        Resources.InvalidOperation_UnitIsPixelOnly, 
     513                        "DialogControlMaxHeight", 
     514                        ID)); 
     515                } 
     516 
     517                ViewState[DialogControlMaxHeightKey] = value; 
    221518            } 
    222519        } 
     
    278575                    } 
    279576 
    280                     WebUtility.FindControl<Dialog>(this, dialogControlId).RegisterOnClientClick(this, navigateMethod, navigateUrl, navigateOptions); 
     577                    WebUtility.FindControl<Dialog>(this, dialogControlId).RegisterOnClientClick( 
     578                        this, 
     579                        new Dialog.DialogOption( 
     580                            DialogControlTitle, 
     581                            DialogControlWidth, 
     582                            DialogControlHeight, 
     583                            DialogControlMinWidth, 
     584                            DialogControlMinHeight, 
     585                            DialogControlMaxWidth, 
     586                            DialogControlMaxHeight), 
     587                        navigateMethod, 
     588                        navigateUrl, 
     589                        navigateOptions); 
    281590                } 
    282591            } 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/HyperLink.cs

    r1625 r1653  
    2929    using System.Web.UI.WebControls; 
    3030    using FCSoft.SilverFrost.Framework.Json; 
     31    using FCSoft.SilverFrost.Framework.Web.Properties; 
    3132 
    3233 
     
    7273        private const string DialogControlKey = "DialogControl"; 
    7374 
     75        /// <summary> 
     76        /// <see cref="DialogControlTitle"/> プロパティ用のキー。 
     77        /// </summary> 
     78        private const string DialogControlTitleKey = "DialogControlTitle"; 
     79 
     80        /// <summary> 
     81        /// <see cref="DialogControlWidth"/> プロパティ用のキー。 
     82        /// </summary> 
     83        private const string DialogControlWidthKey = "DialogControlWidth"; 
     84 
     85        /// <summary> 
     86        /// <see cref="DialogControlHeight"/> プロパティ用のキー。 
     87        /// </summary> 
     88        private const string DialogControlHeightKey = "DialogControlHeight"; 
     89 
     90        /// <summary> 
     91        /// <see cref="DialogControlMinWidth"/> プロパティ用のキー。 
     92        /// </summary> 
     93        private const string DialogControlMinWidthKey = "DialogControlMinWidth"; 
     94 
     95        /// <summary> 
     96        /// <see cref="DialogControlMinHeight"/> プロパティ用のキー。 
     97        /// </summary> 
     98        private const string DialogControlMinHeightKey = "DialogControlMinHeight"; 
     99 
     100        /// <summary> 
     101        /// <see cref="DialogControlMaxWidth"/> プロパティ用のキー。 
     102        /// </summary> 
     103        private const string DialogControlMaxWidthKey = "DialogControlMaxWidth"; 
     104 
     105        /// <summary> 
     106        /// <see cref="DialogControlMaxHeight"/> プロパティ用のキー。 
     107        /// </summary> 
     108        private const string DialogControlMaxHeightKey = "DialogControlMaxHeight"; 
     109 
    74110 
    75111        /// <summary> 
     
    260296 
    261297        /// <summary> 
     298        /// ダイアログのタイトルを取得及び設定します。 
     299        /// </summary> 
     300        /// <value> 
     301        /// ダイアログのタイトル。 
     302        /// 既定値は空の文字列 ("")。 
     303        /// 空の文字列の場合は <see cref="DialogControl"/> で指定された 
     304        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     305        /// </value> 
     306        [Themeable(false)] 
     307        [DefaultValue("")] 
     308        [Localizable(true)] 
     309        [WebCategory("Appearance")] 
     310        [WebDescription("Description_DialogControlTitle")] 
     311        public virtual string DialogControlTitle 
     312        { 
     313            get 
     314            { 
     315                return (string)(ViewState[DialogControlTitleKey] ?? string.Empty); 
     316            } 
     317 
     318            set 
     319            { 
     320                ViewState[DialogControlTitleKey] = value; 
     321            } 
     322        } 
     323 
     324        /// <summary> 
     325        /// ダイアログの幅を取得または設定します。 
     326        /// </summary> 
     327        /// <value> 
     328        /// ダイアログの幅を表す <see cref="Unit"/>。 
     329        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     330        /// 既定値は <see cref="Unit.Empty"/> です。 
     331        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     332        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     333        /// </value> 
     334        /// <exception cref="ArgumentException"> 
     335        /// ピクセル以外の単位が設定されました。 
     336        /// </exception> 
     337        [Bindable(true)] 
     338        [Localizable(true)] 
     339        [DefaultValue(typeof(Unit), "")] 
     340        [WebCategory("Layout")] 
     341        [WebDescription("Description_DialogControlWidth")] 
     342        public virtual Unit DialogControlWidth 
     343        { 
     344            get 
     345            { 
     346                return (Unit)(ViewState[DialogControlWidthKey] ?? Unit.Empty); 
     347            } 
     348 
     349            set 
     350            { 
     351                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     352                { 
     353                    throw new ArgumentException(Utility.Format( 
     354                        Resources.InvalidOperation_UnitIsPixelOnly, 
     355                        "DialogControlWidth", 
     356                        ID)); 
     357                } 
     358 
     359                ViewState[DialogControlWidthKey] = value; 
     360            } 
     361        } 
     362 
     363        /// <summary> 
     364        /// ダイアログの高さを取得または設定します。 
     365        /// </summary> 
     366        /// <value> 
     367        /// ダイアログの高さを表す <see cref="Unit"/>。 
     368        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     369        /// 既定値は <see cref="Unit.Empty"/> です。 
     370        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     371        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     372        /// </value> 
     373        /// <exception cref="ArgumentException"> 
     374        /// ピクセル以外の単位が設定されました。 
     375        /// </exception> 
     376        [Bindable(true)] 
     377        [Localizable(true)] 
     378        [DefaultValue(typeof(Unit), "")] 
     379        [WebCategory("Layout")] 
     380        [WebDescription("Description_DialogControlHeight")] 
     381        public virtual Unit DialogControlHeight 
     382        { 
     383            get 
     384            { 
     385                return (Unit)(ViewState[DialogControlHeightKey] ?? Unit.Empty); 
     386            } 
     387 
     388            set 
     389            { 
     390                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     391                { 
     392                    throw new ArgumentException(Utility.Format( 
     393                        Resources.InvalidOperation_UnitIsPixelOnly, 
     394                        "DialogControlHeight", 
     395                        ID)); 
     396                } 
     397 
     398                ViewState[DialogControlHeightKey] = value; 
     399            } 
     400        } 
     401 
     402        /// <summary> 
     403        /// ダイアログの最小の幅を取得または設定します。 
     404        /// </summary> 
     405        /// <value> 
     406        /// ダイアログの最小の幅を表す <see cref="Unit"/>。 
     407        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     408        /// 既定値は <see cref="Unit.Empty"/> です。 
     409        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     410        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     411        /// </value> 
     412        /// <exception cref="ArgumentException"> 
     413        /// ピクセル以外の単位が設定されました。 
     414        /// </exception> 
     415        [Bindable(true)] 
     416        [Localizable(true)] 
     417        [DefaultValue(typeof(Unit), "")] 
     418        [WebCategory("Layout")] 
     419        [WebDescription("Description_DialogControlMinWidth")] 
     420        public virtual Unit DialogControlMinWidth 
     421        { 
     422            get 
     423            { 
     424                return (Unit)(ViewState[DialogControlMinWidthKey] ?? Unit.Empty); 
     425            } 
     426 
     427            set 
     428            { 
     429                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     430                { 
     431                    throw new ArgumentException(Utility.Format( 
     432                        Resources.InvalidOperation_UnitIsPixelOnly, 
     433                        "DialogControlMinWidth", 
     434                        ID)); 
     435                } 
     436 
     437                ViewState[DialogControlMinWidthKey] = value; 
     438            } 
     439        } 
     440 
     441        /// <summary> 
     442        /// ダイアログの最小の高さを取得または設定します。 
     443        /// </summary> 
     444        /// <value> 
     445        /// ダイアログの最小の高さを表す <see cref="Unit"/>。 
     446        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     447        /// 既定値は <see cref="Unit.Empty"/> です。 
     448        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     449        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     450        /// </value> 
     451        /// <exception cref="ArgumentException"> 
     452        /// ピクセル以外の単位が設定されました。 
     453        /// </exception> 
     454        [Bindable(true)] 
     455        [Localizable(true)] 
     456        [DefaultValue(typeof(Unit), "")] 
     457        [WebCategory("Layout")] 
     458        [WebDescription("Description_DialogControlMinHeight")] 
     459        public virtual Unit DialogControlMinHeight 
     460        { 
     461            get 
     462            { 
     463                return (Unit)(ViewState[DialogControlMinHeightKey] ?? Unit.Empty); 
     464            } 
     465 
     466            set 
     467            { 
     468                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     469                { 
     470                    throw new ArgumentException(Utility.Format( 
     471                        Resources.InvalidOperation_UnitIsPixelOnly, 
     472                        "DialogControlMinHeight", 
     473                        ID)); 
     474                } 
     475 
     476                ViewState[DialogControlMinHeightKey] = value; 
     477            } 
     478        } 
     479 
     480        /// <summary> 
     481        /// ダイアログの最大の幅を取得または設定します。 
     482        /// </summary> 
     483        /// <value> 
     484        /// ダイアログの最大の幅を表す <see cref="Unit"/>。 
     485        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     486        /// 既定値は <see cref="Unit.Empty"/> です。 
     487        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     488        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     489        /// </value> 
     490        /// <exception cref="ArgumentException"> 
     491        /// ピクセル以外の単位が設定されました。 
     492        /// </exception> 
     493        [Bindable(true)] 
     494        [Localizable(true)] 
     495        [DefaultValue(typeof(Unit), "")] 
     496        [WebCategory("Layout")] 
     497        [WebDescription("Description_DialogControlMaxWidth")] 
     498        public virtual Unit DialogControlMaxWidth 
     499        { 
     500            get 
     501            { 
     502                return (Unit)(ViewState[DialogControlMaxWidthKey] ?? Unit.Empty); 
     503            } 
     504 
     505            set 
     506            { 
     507                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     508                { 
     509                    throw new ArgumentException(Utility.Format( 
     510                        Resources.InvalidOperation_UnitIsPixelOnly, 
     511                        "DialogControlMaxWidth", 
     512                        ID)); 
     513                } 
     514 
     515                ViewState[DialogControlMaxWidthKey] = value; 
     516            } 
     517        } 
     518 
     519        /// <summary> 
     520        /// ダイアログの最大の高さを取得または設定します。 
     521        /// </summary> 
     522        /// <value> 
     523        /// ダイアログの最大の高さを表す <see cref="Unit"/>。 
     524        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     525        /// 既定値は <see cref="Unit.Empty"/> です。 
     526        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     527        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     528        /// </value> 
     529        /// <exception cref="ArgumentException"> 
     530        /// ピクセル以外の単位が設定されました。 
     531        /// </exception> 
     532        [Bindable(true)] 
     533        [Localizable(true)] 
     534        [DefaultValue(typeof(Unit), "")] 
     535        [WebCategory("Layout")] 
     536        [WebDescription("Description_DialogControlMaxHeight")] 
     537        public virtual Unit DialogControlMaxHeight 
     538        { 
     539            get 
     540            { 
     541                return (Unit)(ViewState[DialogControlMaxHeightKey] ?? Unit.Empty); 
     542            } 
     543 
     544            set 
     545            { 
     546                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     547                { 
     548                    throw new ArgumentException(Utility.Format( 
     549                        Resources.InvalidOperation_UnitIsPixelOnly, 
     550                        "DialogControlMaxHeight", 
     551                        ID)); 
     552                } 
     553 
     554                ViewState[DialogControlMaxHeightKey] = value; 
     555            } 
     556        } 
     557 
     558        /// <summary> 
    262559        /// 関連付けられているコンテンツ テンプレートを取得または設定します。 
    263560        /// </summary> 
     
    450747            if (!string.IsNullOrEmpty(dialogControlId)) 
    451748            { 
    452                 WebUtility.FindControl<Dialog>(this, dialogControlId).RegisterOnClientClick(this, navigateMethod, navigateUrl, navigateOptions); 
     749                WebUtility.FindControl<Dialog>(this, dialogControlId).RegisterOnClientClick( 
     750                    this, 
     751                    new Dialog.DialogOption( 
     752                        DialogControlTitle, 
     753                        DialogControlWidth, 
     754                        DialogControlHeight, 
     755                        DialogControlMinWidth, 
     756                        DialogControlMinHeight, 
     757                        DialogControlMaxWidth, 
     758                        DialogControlMaxHeight), 
     759                    navigateMethod, 
     760                    navigateUrl, 
     761                    navigateOptions); 
    453762            } 
    454763        } 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/HyperLinkField.cs

    r1200 r1653  
    7272 
    7373        /// <summary> 
     74        /// <see cref="DialogControlTitle"/> プロパティ用のキー。 
     75        /// </summary> 
     76        private const string DialogControlTitleKey = "DialogControlTitle"; 
     77 
     78        /// <summary> 
     79        /// <see cref="DialogControlWidth"/> プロパティ用のキー。 
     80        /// </summary> 
     81        private const string DialogControlWidthKey = "DialogControlWidth"; 
     82 
     83        /// <summary> 
     84        /// <see cref="DialogControlHeight"/> プロパティ用のキー。 
     85        /// </summary> 
     86        private const string DialogControlHeightKey = "DialogControlHeight"; 
     87 
     88        /// <summary> 
     89        /// <see cref="DialogControlMinWidth"/> プロパティ用のキー。 
     90        /// </summary> 
     91        private const string DialogControlMinWidthKey = "DialogControlMinWidth"; 
     92 
     93        /// <summary> 
     94        /// <see cref="DialogControlMinHeight"/> プロパティ用のキー。 
     95        /// </summary> 
     96        private const string DialogControlMinHeightKey = "DialogControlMinHeight"; 
     97 
     98        /// <summary> 
     99        /// <see cref="DialogControlMaxWidth"/> プロパティ用のキー。 
     100        /// </summary> 
     101        private const string DialogControlMaxWidthKey = "DialogControlMaxWidth"; 
     102 
     103        /// <summary> 
     104        /// <see cref="DialogControlMaxHeight"/> プロパティ用のキー。 
     105        /// </summary> 
     106        private const string DialogControlMaxHeightKey = "DialogControlMaxHeight"; 
     107 
     108        /// <summary> 
    74109        /// ナビゲーションのオプション用のキープレフィックス。 
    75110        /// </summary> 
     
    255290 
    256291                ViewState[DialogControlKey] = value; 
     292            } 
     293        } 
     294 
     295        /// <summary> 
     296        /// ダイアログのタイトルを取得及び設定します。 
     297        /// </summary> 
     298        /// <value> 
     299        /// ダイアログのタイトル。 
     300        /// 既定値は空の文字列 ("")。 
     301        /// 空の文字列の場合は <see cref="DialogControl"/> で指定された 
     302        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     303        /// </value> 
     304        [Themeable(false)] 
     305        [DefaultValue("")] 
     306        [Localizable(true)] 
     307        [WebCategory("Appearance")] 
     308        [WebDescription("Description_DialogControlTitle")] 
     309        public virtual string DialogControlTitle 
     310        { 
     311            get 
     312            { 
     313                return (string)(ViewState[DialogControlTitleKey] ?? string.Empty); 
     314            } 
     315 
     316            set 
     317            { 
     318                ViewState[DialogControlTitleKey] = value; 
     319            } 
     320        } 
     321 
     322        /// <summary> 
     323        /// ダイアログの幅を取得または設定します。 
     324        /// </summary> 
     325        /// <value> 
     326        /// ダイアログの幅を表す <see cref="Unit"/>。 
     327        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     328        /// 既定値は <see cref="Unit.Empty"/> です。 
     329        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     330        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     331        /// </value> 
     332        /// <exception cref="ArgumentException"> 
     333        /// ピクセル以外の単位が設定されました。 
     334        /// </exception> 
     335        [Bindable(true)] 
     336        [Localizable(true)] 
     337        [DefaultValue(typeof(Unit), "")] 
     338        [WebCategory("Layout")] 
     339        [WebDescription("Description_DialogControlWidth")] 
     340        public virtual Unit DialogControlWidth 
     341        { 
     342            get 
     343            { 
     344                return (Unit)(ViewState[DialogControlWidthKey] ?? Unit.Empty); 
     345            } 
     346 
     347            set 
     348            { 
     349                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     350                { 
     351                    throw new ArgumentException(Utility.Format( 
     352                        Resources.InvalidOperation_UnitIsPixelOnly, 
     353                        "DialogControlWidth", 
     354                        "HyperLinkField")); 
     355                } 
     356 
     357                ViewState[DialogControlWidthKey] = value; 
     358            } 
     359        } 
     360 
     361        /// <summary> 
     362        /// ダイアログの高さを取得または設定します。 
     363        /// </summary> 
     364        /// <value> 
     365        /// ダイアログの高さを表す <see cref="Unit"/>。 
     366        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     367        /// 既定値は <see cref="Unit.Empty"/> です。 
     368        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     369        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     370        /// </value> 
     371        /// <exception cref="ArgumentException"> 
     372        /// ピクセル以外の単位が設定されました。 
     373        /// </exception> 
     374        [Bindable(true)] 
     375        [Localizable(true)] 
     376        [DefaultValue(typeof(Unit), "")] 
     377        [WebCategory("Layout")] 
     378        [WebDescription("Description_DialogControlHeight")] 
     379        public virtual Unit DialogControlHeight 
     380        { 
     381            get 
     382            { 
     383                return (Unit)(ViewState[DialogControlHeightKey] ?? Unit.Empty); 
     384            } 
     385 
     386            set 
     387            { 
     388                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     389                { 
     390                    throw new ArgumentException(Utility.Format( 
     391                        Resources.InvalidOperation_UnitIsPixelOnly, 
     392                        "DialogControlHeight", 
     393                        "HyperLinkField")); 
     394                } 
     395 
     396                ViewState[DialogControlHeightKey] = value; 
     397            } 
     398        } 
     399 
     400        /// <summary> 
     401        /// ダイアログの最小の幅を取得または設定します。 
     402        /// </summary> 
     403        /// <value> 
     404        /// ダイアログの最小の幅を表す <see cref="Unit"/>。 
     405        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     406        /// 既定値は <see cref="Unit.Empty"/> です。 
     407        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     408        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     409        /// </value> 
     410        /// <exception cref="ArgumentException"> 
     411        /// ピクセル以外の単位が設定されました。 
     412        /// </exception> 
     413        [Bindable(true)] 
     414        [Localizable(true)] 
     415        [DefaultValue(typeof(Unit), "")] 
     416        [WebCategory("Layout")] 
     417        [WebDescription("Description_DialogControlMinWidth")] 
     418        public virtual Unit DialogControlMinWidth 
     419        { 
     420            get 
     421            { 
     422                return (Unit)(ViewState[DialogControlMinWidthKey] ?? Unit.Empty); 
     423            } 
     424 
     425            set 
     426            { 
     427                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     428                { 
     429                    throw new ArgumentException(Utility.Format( 
     430                        Resources.InvalidOperation_UnitIsPixelOnly, 
     431                        "DialogControlMinWidth", 
     432                        "HyperLinkField")); 
     433                } 
     434 
     435                ViewState[DialogControlMinWidthKey] = value; 
     436            } 
     437        } 
     438 
     439        /// <summary> 
     440        /// ダイアログの最小の高さを取得または設定します。 
     441        /// </summary> 
     442        /// <value> 
     443        /// ダイアログの最小の高さを表す <see cref="Unit"/>。 
     444        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     445        /// 既定値は <see cref="Unit.Empty"/> です。 
     446        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     447        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     448        /// </value> 
     449        /// <exception cref="ArgumentException"> 
     450        /// ピクセル以外の単位が設定されました。 
     451        /// </exception> 
     452        [Bindable(true)] 
     453        [Localizable(true)] 
     454        [DefaultValue(typeof(Unit), "")] 
     455        [WebCategory("Layout")] 
     456        [WebDescription("Description_DialogControlMinHeight")] 
     457        public virtual Unit DialogControlMinHeight 
     458        { 
     459            get 
     460            { 
     461                return (Unit)(ViewState[DialogControlMinHeightKey] ?? Unit.Empty); 
     462            } 
     463 
     464            set 
     465            { 
     466                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     467                { 
     468                    throw new ArgumentException(Utility.Format( 
     469                        Resources.InvalidOperation_UnitIsPixelOnly, 
     470                        "DialogControlMinHeight", 
     471                        "HyperLinkField")); 
     472                } 
     473 
     474                ViewState[DialogControlMinHeightKey] = value; 
     475            } 
     476        } 
     477 
     478        /// <summary> 
     479        /// ダイアログの最大の幅を取得または設定します。 
     480        /// </summary> 
     481        /// <value> 
     482        /// ダイアログの最大の幅を表す <see cref="Unit"/>。 
     483        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     484        /// 既定値は <see cref="Unit.Empty"/> です。 
     485        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     486        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     487        /// </value> 
     488        /// <exception cref="ArgumentException"> 
     489        /// ピクセル以外の単位が設定されました。 
     490        /// </exception> 
     491        [Bindable(true)] 
     492        [Localizable(true)] 
     493        [DefaultValue(typeof(Unit), "")] 
     494        [WebCategory("Layout")] 
     495        [WebDescription("Description_DialogControlMaxWidth")] 
     496        public virtual Unit DialogControlMaxWidth 
     497        { 
     498            get 
     499            { 
     500                return (Unit)(ViewState[DialogControlMaxWidthKey] ?? Unit.Empty); 
     501            } 
     502 
     503            set 
     504            { 
     505                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     506                { 
     507                    throw new ArgumentException(Utility.Format( 
     508                        Resources.InvalidOperation_UnitIsPixelOnly, 
     509                        "DialogControlMaxWidth", 
     510                        "HyperLinkField")); 
     511                } 
     512 
     513                ViewState[DialogControlMaxWidthKey] = value; 
     514            } 
     515        } 
     516 
     517        /// <summary> 
     518        /// ダイアログの最大の高さを取得または設定します。 
     519        /// </summary> 
     520        /// <value> 
     521        /// ダイアログの最大の高さを表す <see cref="Unit"/>。 
     522        /// 単位は <c>UnitType.Pixel</c> のみ指定可能です。 
     523        /// 既定値は <see cref="Unit.Empty"/> です。 
     524        /// <see cref="Unit.Empty"/> の場合は <see cref="DialogControl"/> で指定された 
     525        /// <see cref="Dialog"/> コントロールの設定が使用されます。 
     526        /// </value> 
     527        /// <exception cref="ArgumentException"> 
     528        /// ピクセル以外の単位が設定されました。 
     529        /// </exception> 
     530        [Bindable(true)] 
     531        [Localizable(true)] 
     532        [DefaultValue(typeof(Unit), "")] 
     533        [WebCategory("Layout")] 
     534        [WebDescription("Description_DialogControlMaxHeight")] 
     535        public virtual Unit DialogControlMaxHeight 
     536        { 
     537            get 
     538            { 
     539                return (Unit)(ViewState[DialogControlMaxHeightKey] ?? Unit.Empty); 
     540            } 
     541 
     542            set 
     543            { 
     544                if (!value.IsEmpty && value.Type != UnitType.Pixel) 
     545                { 
     546                    throw new ArgumentException(Utility.Format( 
     547                        Resources.InvalidOperation_UnitIsPixelOnly, 
     548                        "DialogControlMaxHeight", 
     549                        "HyperLinkField")); 
     550                } 
     551 
     552                ViewState[DialogControlMaxHeightKey] = value; 
    257553            } 
    258554        } 
     
    537833            } 
    538834 
    539             WebUtility.FindControl<Dialog>(boundControl, dialogControlId).RegisterOnClientClick(boundControl, navigateMethod, navigateUrl, navigateOptions); 
     835            WebUtility.FindControl<Dialog>(boundControl, dialogControlId).RegisterOnClientClick( 
     836                boundControl, 
     837                new Dialog.DialogOption( 
     838                    DialogControlTitle, 
     839                    DialogControlWidth, 
     840                    DialogControlHeight, 
     841                    DialogControlMinWidth, 
     842                    DialogControlMinHeight, 
     843                    DialogControlMaxWidth, 
     844                    DialogControlMaxHeight), 
     845                navigateMethod, 
     846                navigateUrl, 
     847                navigateOptions); 
    540848        } 
    541849 
詳しい使い方は TracChangeset を参照してください。