チェンジセット 1609 (default)


以下の違いを無視:
日時:
2023/09/11 20:42:48 (13ヵ月前)
更新者:
hizuya@…
ログメッセージ:
  • Localize.Text が、master ページや UserControl の場合に正しくリソースから取得されない問題を修正。
場所:
framework/trunk/WebLibrary/Sources
ファイル:
2個の更新

凡例:

未変更
追加
削除
  • framework/trunk/WebLibrary/Sources/ResourceUtility.cs

    r864 r1609  
    2626    using System.ComponentModel; 
    2727    using System.Globalization; 
     28    using System.IO; 
    2829    using System.Reflection; 
    2930    using System.Resources; 
     
    6869        /// <paramref name="resourceKeyWithLocation"/> が <see langword="null"/> 参照です。 
    6970        /// </exception> 
     71        /// <exception cref="MissingManifestResourceException"> 
     72        /// 使用できるリソースのセットが見つからず、既定のカルチャ リソースもありません。 
     73        /// </exception> 
     74        /// <exception cref="MissingSatelliteAssemblyException"> 
     75        /// 既定のカルチャのリソースがサテライト アセンブリに存在し、そのサテライト アセンブリが見つかりませんでした。 
     76        /// </exception> 
     77        /// <exception cref="FileNotFoundException"> 
     78        /// アセンブリが見つかりません。 
     79        /// </exception> 
     80        /// <exception cref="FileLoadException"> 
     81        /// 見つかったファイルを読み込むことができませんでした。 
     82        /// </exception> 
     83        /// <exception cref="BadImageFormatException"> 
     84        /// アセンブリが有効なアセンブリではありません。 
     85        /// または 現在、Version 2.0 以降の共通言語ランタイムが読み込まれていますが、 
     86        /// それよりも新しいバージョンを使用してアセンブリがコンパイルされています。 
     87        /// </exception> 
    7088        public static object GetResourceObject(string resourceKeyWithLocation, CultureInfo uiCulture, string defaultLocation) 
    7189        { 
     
    119137        /// <paramref name="resourceKey"/> が <see langword="null"/> 参照です。 
    120138        /// </exception> 
     139        /// <exception cref="MissingManifestResourceException"> 
     140        /// 使用できるリソースのセットが見つからず、既定のカルチャ リソースもありません。 
     141        /// </exception> 
     142        /// <exception cref="MissingSatelliteAssemblyException"> 
     143        /// 既定のカルチャのリソースがサテライト アセンブリに存在し、そのサテライト アセンブリが見つかりませんでした。 
     144        /// </exception> 
     145        /// <exception cref="FileNotFoundException"> 
     146        /// アセンブリが見つかりません。 
     147        /// </exception> 
     148        /// <exception cref="FileLoadException"> 
     149        /// 見つかったファイルを読み込むことができませんでした。 
     150        /// </exception> 
     151        /// <exception cref="BadImageFormatException"> 
     152        /// アセンブリが有効なアセンブリではありません。 
     153        /// または 現在、Version 2.0 以降の共通言語ランタイムが読み込まれていますが、 
     154        /// それよりも新しいバージョンを使用してアセンブリがコンパイルされています。 
     155        /// </exception> 
    121156        public static object GetResourceObject(string location, string resourceKey, CultureInfo uiCulture) 
    122157        { 
     
    132167            } 
    133168 
    134             if (location.StartsWith("~/")) 
     169            if (location.StartsWith("~/", StringComparison.Ordinal)) 
    135170            { 
    136171                // 先頭が ~/ で始まっている場合はそのまま 
    137172            } 
    138             else if (!location.StartsWith("/")) 
     173            else if (!location.StartsWith("/", StringComparison.Ordinal)) 
    139174            { 
    140175                int parsePosition; 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/Localize.cs

    r1276 r1609  
    275275            } 
    276276 
     277            TemplateControl templateControl = TemplateControl; 
     278 
     279            // ReSharper disable ExceptionNotDocumented 
    277280            string newText 
    278281                = ResourceUtility.GetResourceObject( 
    279282                    resourceKey, 
    280283                    CultureInfo.CurrentUICulture, 
    281                     Page != null ? Page.Request.AppRelativeCurrentExecutionFilePath : null) as string; 
    282  
     284                    templateControl != null ? templateControl.AppRelativeVirtualPath : null) as string; 
     285            // ReSharper restore ExceptionNotDocumented 
    283286            if (newText != null) 
    284287            { 
詳しい使い方は TracChangeset を参照してください。