예제 #1
0
        public static void RenderCssLinks(Control control, IEnumerable <string> cssFiles)
        {
            bool isRtl = RtlUtil.IsRtl;

            CssFiles.CssFile cssFile = null;
            if (!CssFiles.cultureAwareCssFileTable.TryGetValue(CultureInfo.CurrentUICulture.LCID, out cssFile))
            {
                cssFile = CssFiles.mainDefaultCss;
            }
            CssFiles.OutputCssLink(control, cssFile, isRtl);
            if (cssFiles != null)
            {
                foreach (string text in cssFiles)
                {
                    CssFiles.CssFile cssFile2 = CssFiles.nameToCssFileTable[text];
                    if (cssFile2 == null)
                    {
                        throw new InvalidOperationException(string.Format("File name {0} isn't map to any predefined CssFile. Make sure you type the correct css file name.", text));
                    }
                    CssFiles.OutputCssLink(control, cssFile2, isRtl);
                }
            }
        }
예제 #2
0
 private static void OutputCssLink(Control control, CssFiles.CssFile cssFile, bool isRtl)
 {
     CssFiles.OutputCssLink(control.Page.Response.Output, ThemeResource.GetThemeResource(control.Page, (isRtl && cssFile.RtlFileName != null) ? cssFile.RtlFileName : cssFile.FileName));
 }