チェンジセット 1642 (default)


以下の違いを無視:
日時:
2024/03/13 17:51:51 (7ヵ月前)
更新者:
hizuya@…
ログメッセージ:
  • StyleUtility で ContentPlaceHolder を使っている場合でも正しい位置に埋め込まれるように対応。
場所:
framework/trunk
ファイル:
14個の追加
2個の更新

凡例:

未変更
追加
削除
  • framework/trunk/WebApplication/WebApplication.csproj

    r1641 r1642  
    6060    <Content Include="Scripts\test1.js" /> 
    6161    <Content Include="Scripts\test2.js" /> 
     62    <Content Include="Styles\test-block-1.css" /> 
     63    <Content Include="Styles\test-block-2.css" /> 
    6264    <Content Include="Styles\test1.css" /> 
    6365    <Content Include="Styles\test2.css" /> 
     66    <Content Include="UI\StyleNonPriorityPage.aspx" /> 
     67    <Content Include="UI\StylePriorityPage.aspx" /> 
     68    <Content Include="UI\StylePriorityWithContentPlaceHolderPage.aspx" /> 
    6469    <Content Include="UI\CompoundClientScript.aspx" /> 
    6570    <Content Include="UI\CulturePage.aspx" /> 
     
    189194    <Compile Include="Services\SimpleServiceMethod.cs" /> 
    190195    <Compile Include="Services\WaitServiceMethod.cs" /> 
     196    <Compile Include="UI\StyleNonPriorityPage.aspx.cs"> 
     197      <DependentUpon>StyleNonPriorityPage.aspx</DependentUpon> 
     198      <SubType>ASPXCodeBehind</SubType> 
     199    </Compile> 
     200    <Compile Include="UI\StyleNonPriorityPage.aspx.designer.cs"> 
     201      <DependentUpon>StyleNonPriorityPage.aspx</DependentUpon> 
     202    </Compile> 
     203    <Compile Include="UI\StylePriorityPage.aspx.cs"> 
     204      <DependentUpon>StylePriorityPage.aspx</DependentUpon> 
     205      <SubType>ASPXCodeBehind</SubType> 
     206    </Compile> 
     207    <Compile Include="UI\StylePriorityPage.aspx.designer.cs"> 
     208      <DependentUpon>StylePriorityPage.aspx</DependentUpon> 
     209    </Compile> 
     210    <Compile Include="UI\StylePriorityWithContentPlaceHolderPage.aspx.cs"> 
     211      <DependentUpon>StylePriorityWithContentPlaceHolderPage.aspx</DependentUpon> 
     212      <SubType>ASPXCodeBehind</SubType> 
     213    </Compile> 
     214    <Compile Include="UI\StylePriorityWithContentPlaceHolderPage.aspx.designer.cs"> 
     215      <DependentUpon>StylePriorityWithContentPlaceHolderPage.aspx</DependentUpon> 
     216    </Compile> 
     217    <Compile Include="UI\StylePriorityWithContentPlaceHolderMaster.master.cs"> 
     218      <DependentUpon>StylePriorityWithContentPlaceHolderMaster.master</DependentUpon> 
     219      <SubType>ASPXCodeBehind</SubType> 
     220    </Compile> 
     221    <Compile Include="UI\StylePriorityWithContentPlaceHolderMaster.master.designer.cs"> 
     222      <DependentUpon>StylePriorityWithContentPlaceHolderMaster.master</DependentUpon> 
     223    </Compile> 
    191224    <Compile Include="UI\CompoundClientScript.aspx.cs"> 
    192225      <DependentUpon>CompoundClientScript.aspx</DependentUpon> 
     
    650683    <Content Include="App_Themes\Blue\Controls.skin" /> 
    651684    <Content Include="App_Themes\Red\Controls.skin" /> 
     685    <Content Include="UI\StylePriorityWithContentPlaceHolderMaster.master" /> 
    652686  </ItemGroup> 
    653687  <ItemGroup> 
  • framework/trunk/WebLibrary/Sources/UI/StyleUtility.cs

    r1347 r1642  
    175175        /// <param name="priority"> 
    176176        /// <c>head</c> 内に設定された <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
    177         /// によるスタイルより優先する場合は <see langword="true"/>。 
     177        /// によるスタイルより先に登録する場合は <see langword="true"/>。 
    178178        /// それ以外の場合は <see langword="false"/>。 
    179179        /// </param> 
     
    211211        /// <param name="priority"> 
    212212        /// <c>head</c> 内に設定された <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
    213         /// によるスタイルより優先する場合は <see langword="true"/>。 
     213        /// によるスタイルより先に登録する場合は <see langword="true"/>。 
    214214        /// それ以外の場合は <see langword="false"/>。 
    215215        /// </param> 
     
    276276        /// <param name="priority"> 
    277277        /// <c>head</c> 内に設定された <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
    278         /// によるスタイルより優先する場合は <see langword="true"/>。 
     278        /// によるスタイルより先に登録する場合は <see langword="true"/>。 
    279279        /// それ以外の場合は <see langword="false"/>。 
    280280        /// </param> 
     
    310310        /// <param name="priority"> 
    311311        /// <c>head</c> 内に設定された <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
    312         /// によるスタイルより優先する場合は <see langword="true"/>。 
     312        /// によるスタイルより先に登録する場合は <see langword="true"/>。 
    313313        /// それ以外の場合は <see langword="false"/>。 
    314314        /// </param> 
     
    432432        /// <param name="priority"> 
    433433        /// <c>head</c> 内に設定された <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
    434         /// によるスタイルより優先する場合は <see langword="true"/>。 
     434        /// によるスタイルより先に登録する場合は <see langword="true"/>。 
    435435        /// それ以外の場合は <see langword="false"/>。 
    436436        /// </param> 
     
    463463                foreach (Control headerControl in page.Header.Controls) 
    464464                { 
    465                     if (headerControl is System.Web.UI.HtmlControls.HtmlLink) 
     465                    if (ContainsHtmlLink(headerControl)) 
    466466                    { 
    467467                        break; 
     
    485485 
    486486            page.Header.Controls.AddAt(index, control); 
     487        } 
     488 
     489        /// <summary> 
     490        /// 指定したコントロールが <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
     491        /// を含むかどうかを返します。 
     492        /// </summary> 
     493        /// <param name="control">調べるコントロール。</param> 
     494        /// <returns> 
     495        /// <paramref name="control"/> が 
     496        /// <see cref="System.Web.UI.HtmlControls.HtmlLink"/> を含む場合は <see langword="true"/>。 
     497        /// それ以外の場合は <see langword="false"/>。 
     498        /// </returns> 
     499        private static bool ContainsHtmlLink(Control control) 
     500        { 
     501            if (control == null) 
     502            { 
     503                return false; 
     504            } 
     505 
     506            if (control is System.Web.UI.HtmlControls.HtmlLink) 
     507            { 
     508                return true; 
     509            } 
     510 
     511            HtmlGenericControl genericControl = control as HtmlGenericControl; 
     512            if (genericControl != null && string.Equals(genericControl.TagName, "link", StringComparison.OrdinalIgnoreCase)) 
     513            { 
     514                return true; 
     515            } 
     516 
     517 
     518            foreach (Control childControl in control.Controls) 
     519            { 
     520                if (ContainsHtmlLink(childControl)) 
     521                { 
     522                    return true; 
     523                } 
     524            } 
     525 
     526            return false; 
    487527        } 
    488528 
     
    700740        { 
    701741            /// <summary> 
    702             /// 優先するかどうか。 
     742            /// 先に登録するかどうか。 
    703743            /// </summary> 
    704744            private readonly bool priority; 
     
    713753            /// <param name="priority"> 
    714754            /// <c>head</c> 内に設定された <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
    715             /// によるスタイルより優先する場合は <see langword="true"/>。 
     755            /// によるスタイルより先に登録する場合は <see langword="true"/>。 
    716756            /// それ以外の場合は <see langword="false"/>。 
    717757            /// </param> 
     
    724764 
    725765            /// <summary> 
    726             /// 優先するかどうかを取得します。 
     766            /// 先に登録するかどうかを取得します。 
    727767            /// </summary> 
    728768            /// <value> 
    729769            /// <c>head</c> 内に設定された <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
    730             /// によるスタイルより優先する場合は <see langword="true"/>。 
     770            /// によるスタイルより先に登録する場合は <see langword="true"/>。 
    731771            /// それ以外の場合は <see langword="false"/>。 
    732772            /// </value> 
     
    754794            /// <param name="priority"> 
    755795            /// <c>head</c> 内に設定された <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
    756             /// によるスタイルより優先する場合は <see langword="true"/>。 
     796            /// によるスタイルより先に登録する場合は <see langword="true"/>。 
    757797            /// それ以外の場合は <see langword="false"/>。 
    758798            /// </param> 
     
    797837            /// <param name="priority"> 
    798838            /// <c>head</c> 内に設定された <see cref="System.Web.UI.HtmlControls.HtmlLink"/> 
    799             /// によるスタイルより優先する場合は <see langword="true"/>。 
     839            /// によるスタイルより先に登録する場合は <see langword="true"/>。 
    800840            /// それ以外の場合は <see langword="false"/>。 
    801841            /// </param> 
詳しい使い方は TracChangeset を参照してください。